diff --git a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter index 5bb55ae7a..0b9835136 100755 --- a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter +++ b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter @@ -985,13 +985,13 @@ function interfaces_status() local latency = "" local server_ping = "" - if connectivity ~= "ERROR" and ifname ~= "" and gateway ~= "" and gw_ping ~= "DOWN" and ifname ~= nil and mArray.openmptcprouter["service_addr"] ~= "" then + if connectivity ~= "ERROR" and ifname ~= "" and gateway ~= "" and gw_ping ~= "DOWN" and ifname ~= nil and mArray.openmptcprouter["service_addr"] ~= "" and ipaddr ~= "" then local serverip = mArray.openmptcprouter["service_addr"] if serverip == "127.0.0.1" then serverip = mArray.openmptcprouter["wan_addr"] end if serverip ~= "" and uci:get("openmptcprouter", "settings", "disableserverping") ~= "1" then - local server_ping_test = sys.exec("ping -w 1 -c 1 -I " .. ifname .. " " .. serverip) + local server_ping_test = sys.exec("ping -B -w 1 -c 1 -I " .. ifname .. " " .. serverip) local server_ping_result = ut.trim(sys.exec("echo '" .. server_ping_test .. "' | grep '100% packet loss'")) if server_ping_result ~= "" then server_ping = "DOWN" diff --git a/omr-tracker/files/bin/omr-tracker b/omr-tracker/files/bin/omr-tracker index 4ce4c1ae6..0512a9774 100755 --- a/omr-tracker/files/bin/omr-tracker +++ b/omr-tracker/files/bin/omr-tracker @@ -77,9 +77,9 @@ _post_tracking() { _ping_server() { local serverip=$(uci -q get openmptcprouter.$1.ip) - local deviceip=$2 - if [ -n "$serverip" ] && [ -n "$deviceip" ]; then - _ping $serverip $deviceip "yes" + local device=$2 + if [ -n "$serverip" ] && [ -n "$device" ]; then + _ping $serverip $device "yes" statusp=$? if $(exit $statusp); then serverip_ping=true @@ -91,9 +91,9 @@ _ping_server() { _ping() { local host=$1 - local deviceip=$2 + local device=$2 local localip=$3 - ret=$(ping -I "${deviceip}" \ + ret=$(ping -B -I "${device}" \ -w "$OMR_TRACKER_TIMEOUT" \ -c 1 \ -q \ @@ -200,7 +200,7 @@ while true; do tries="$OMR_TRACKER_TRIES" # loop until tries attempts have been reached while [ "$tries" -gt 0 ]; do - _ping "$OMR_TRACKER_DEVICE_GATEWAY" "$OMR_TRACKER_DEVICE_IP" "no" + _ping "$OMR_TRACKER_DEVICE_GATEWAY" "$OMR_TRACKER_DEVICE" "no" status=$? if $(exit $status) && [ "$OMR_TRACKER_TYPE" = "none" ]; then OMR_TRACKER_STATUS_MSG="" @@ -213,7 +213,7 @@ while true; do serverip_ping=false if [ "$OMR_TRACKER_TYPE" = "ping" ]; then config_load openmptcprouter - config_foreach _ping_server server $OMR_TRACKER_DEVICE_IP + config_foreach _ping_server server $OMR_TRACKER_DEVICE fi if [ "$serverip_ping" = false ]; then # Check if route is not used @@ -225,7 +225,7 @@ while true; do _restart done if [ "$OMR_TRACKER_TYPE" = "ping" ]; then - _ping "$OMR_TRACKER_HOST" "$OMR_TRACKER_DEVICE_IP" "yes" + _ping "$OMR_TRACKER_HOST" "$OMR_TRACKER_DEVICE" "yes" statusb=$? elif [ "$OMR_TRACKER_TYPE" = "httping" ]; then _httping "$OMR_TRACKER_HOST" "$OMR_TRACKER_DEVICE_IP" "yes"