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

Fix tracker and add default config for tunnel

This commit is contained in:
Ycarus 2018-03-25 20:48:48 +02:00
parent 1454020a47
commit 3ae780bcf8
2 changed files with 40 additions and 26 deletions

View file

@ -163,6 +163,9 @@ while true; do
_ping "$OMR_TRACKER_DEVICE_GATEWAY" "$OMR_TRACKER_DEVICE_IP" "no"
status=$?
if $(exit $status); then
if [ "$OMR_TRACKER_TYPE" = "none" ]; then
OMR_TRACKER_STATUS="OK"
else
# setup loop variable
tries="$OMR_TRACKER_TRIES"
ip route replace "$OMR_TRACKER_HOST" via "$OMR_TRACKER_DEVICE_GATEWAY" dev "$OMR_TRACKER_DEVICE" src "$OMR_TRACKER_DEVICE_IP"
@ -177,9 +180,6 @@ while true; do
elif [ "$OMR_TRACKER_TYPE" = "dns" ]; then
_dns "$OMR_TRACKER_HOST" "$OMR_TRACKER_DEVICE_IP" "yes"
status=$?
elif [ "$OMR_TRACKER_TYPE" = "none" ]; then
_none
status=$?
fi
if $(exit $status); then
OMR_TRACKER_STATUS="OK"
@ -188,7 +188,8 @@ while true; do
tries=$((tries - 1))
OMR_TRACKER_TIMEOUT=$((OMR_TRACKER_TIMEOUT * 2))
done
ip route del "$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
fi
fi
fi
fi

View file

@ -0,0 +1,13 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
set omr-tracker.tun0=interface
set omr-tracker.tun0.type="none"
set omr-tracker.tun0.timeout=1
set omr-tracker.tun0.tries=4
set omr-tracker.tun0.interval=2
commit omr-tracker
EOF
rm -f /tmp/luci-indexcache
exit 0