mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix route already exist
This commit is contained in:
parent
f2c9e12676
commit
96f4ab7c7a
1 changed files with 5 additions and 2 deletions
|
@ -177,13 +177,14 @@ while true; do
|
||||||
OMR_TRACKER_STATUS_MSG=""
|
OMR_TRACKER_STATUS_MSG=""
|
||||||
OMR_TRACKER_STATUS="OK"
|
OMR_TRACKER_STATUS="OK"
|
||||||
break
|
break
|
||||||
else
|
elif [ "$OMR_TRACKER_TYPE" != "none" ]; then
|
||||||
if $(exit $status); then
|
if ! $(exit $status); then
|
||||||
OMR_TRACKER_STATUS_MSG="gateway down"
|
OMR_TRACKER_STATUS_MSG="gateway down"
|
||||||
fi
|
fi
|
||||||
# Check if route is not used
|
# Check if route is not used
|
||||||
while ! ip route add $OMR_TRACKER_HOST via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE src $OMR_TRACKER_DEVICE_IP > /dev/null 2&>1
|
while ! ip route add $OMR_TRACKER_HOST via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE src $OMR_TRACKER_DEVICE_IP > /dev/null 2&>1
|
||||||
do
|
do
|
||||||
|
ip route del "$OMR_TRACKER_HOST" via "$OMR_TRACKER_DEVICE_GATEWAY" dev "$OMR_TRACKER_DEVICE" src "$OMR_TRACKER_DEVICE_IP" > /dev/null 2&>1
|
||||||
sleep 1
|
sleep 1
|
||||||
_restart
|
_restart
|
||||||
done
|
done
|
||||||
|
@ -209,6 +210,8 @@ while true; do
|
||||||
OMR_TRACKER_LIST_HOSTS="$OMR_TRACKER_LIST_HOSTS,$OMR_TRACKER_HOST"
|
OMR_TRACKER_LIST_HOSTS="$OMR_TRACKER_LIST_HOSTS,$OMR_TRACKER_HOST"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
elif ! $(exit $status); then
|
||||||
|
OMR_TRACKER_STATUS_MSG="gateway down"
|
||||||
fi
|
fi
|
||||||
tries=$((tries - 1))
|
tries=$((tries - 1))
|
||||||
#_restart
|
#_restart
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue