1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Delete route only if exist

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-03-18 15:50:39 +01:00
parent 9b32a6aab5
commit 728253d324

View file

@ -359,7 +359,7 @@ while true; do
_dns "$OMR_TRACKER_HOST" "$OMR_TRACKER_DEVICE_IP" "yes" _dns "$OMR_TRACKER_HOST" "$OMR_TRACKER_DEVICE_IP" "yes"
statusb=$? statusb=$?
fi fi
ip route del "$OMR_TRACKER_HOST" via "$OMR_TRACKER_DEVICE_GATEWAY" dev "$OMR_TRACKER_DEVICE" src "$OMR_TRACKER_DEVICE_IP" > /dev/null 2>&1 [ -n "$(ip route show ${OMR_TRACKER_HOST} via ${OMR_TRACKER_DEVICE_GATEWAY} dev ${OMR_TRACKER_DEVICE} src ${OMR_TRACKER_DEVICE_IP})" ] && ip route del "$OMR_TRACKER_HOST" via "$OMR_TRACKER_DEVICE_GATEWAY" dev "$OMR_TRACKER_DEVICE" src "$OMR_TRACKER_DEVICE_IP" > /dev/null 2>&1
if $(exit $statusb); then if $(exit $statusb); then
OMR_TRACKER_STATUS_MSG="" OMR_TRACKER_STATUS_MSG=""
OMR_TRACKER_STATUS="OK" OMR_TRACKER_STATUS="OK"