1
0
Fork 0
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:
Ycarus 2018-09-07 11:14:17 +02:00
parent f2c9e12676
commit 96f4ab7c7a

View file

@ -177,13 +177,14 @@ while true; do
OMR_TRACKER_STATUS_MSG=""
OMR_TRACKER_STATUS="OK"
break
else
if $(exit $status); then
elif [ "$OMR_TRACKER_TYPE" != "none" ]; then
if ! $(exit $status); then
OMR_TRACKER_STATUS_MSG="gateway down"
fi
# 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
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
_restart
done
@ -209,6 +210,8 @@ while true; do
OMR_TRACKER_LIST_HOSTS="$OMR_TRACKER_LIST_HOSTS,$OMR_TRACKER_HOST"
fi
fi
elif ! $(exit $status); then
OMR_TRACKER_STATUS_MSG="gateway down"
fi
tries=$((tries - 1))
#_restart