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

Fixes for IPv6 in OMR-Tracker

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-01-23 14:55:59 +01:00
parent 8e5a8f8694
commit 086c13516f

View file

@ -501,10 +501,10 @@ while true; do
_ping "$OMR_TRACKER_HOST6" "$OMR_TRACKER_DEVICE" "yes"
statusb=$?
elif [ "$OMR_TRACKER_TYPE" = "httping" ]; then
_httping "$OMR_TRACKER_HOST6" "$OMR_TRACKER_DEVICE_IP" "yes"
_httping "$OMR_TRACKER_HOST6" "$OMR_TRACKER_DEVICE_IP6" "yes"
statusb=$?
elif [ "$OMR_TRACKER_TYPE" = "dns" ]; then
_dns "$OMR_TRACKER_HOST6" "$OMR_TRACKER_DEVICE_IP" "yes"
_dns "$OMR_TRACKER_HOST6" "$OMR_TRACKER_DEVICE_IP6" "yes"
statusb=$?
fi
ip -6 route del "$OMR_TRACKER_HOST6" via "$OMR_TRACKER_DEVICE_GATEWAY6" dev "$OMR_TRACKER_DEVICE" src "$OMR_TRACKER_DEVICE_IP6" > /dev/null 2>&1
@ -530,7 +530,7 @@ while true; do
if [ "$serverip_ping" != false ] && [ "$OMR_TRACKER_STATUS" = "OK" ] && [ "$OMR_TRACKER_TYPE" != "httping" ] && [ "$OMR_TRACKER_SERVER_HTTP_TEST" = "1" ]; then
serverip_ping=false
config_load openmptcprouter
config_foreach _httping_server server $OMR_TRACKER_DEVICE_IP
config_foreach _httping_server server $OMR_TRACKER_DEVICE_IP6
if [ "$serverip_ping" = false ]; then
OMR_TRACKER_STATUS_MSG="No access to server API"
#OMR_TRACKER_STATUS="ERROR"
@ -554,7 +554,7 @@ while true; do
sleep "${OMR_TRACKER_INTERVAL_TRIES:-1}"
done
fi
if [ -z "$OMR_TRACKER_DEVICE_IP" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ -z "$OMR_TRACKER_DEVICE_IP6" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then
if [ "$OMR_TRACKER_STATUS" = "ERROR" ] && ([ -z "$OMR_TRACKER_DEVICE_IP" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ -z "$OMR_TRACKER_DEVICE_IP6" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ]); then
[ -z "$OMR_TRACKER_STATUS_MSG" ] && OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_INTERFACE may have ip issues"
[ -z "$OMR_TRACKER_DEVICE_IP" ] && OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_STATUS_MSG, interface have no IPv4"
[ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] && OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_STATUS_MSG, interface have no IPv4 gateway"
@ -577,9 +577,9 @@ while true; do
fi
if [ "$OMR_TRACKER_LIST_HOSTS6" != "" ]; then
if [ "$OMR_TRACKER_STATUS_MSG" = "" ]; then
OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_TYPE from $OMR_TRACKER_DEVICE_IP error ($OMR_TRACKER_LIST_HOSTS6)"
OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_TYPE from $OMR_TRACKER_DEVICE_IP6 error ($OMR_TRACKER_LIST_HOSTS6)"
else
OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_STATUS_MSG and $OMR_TRACKER_TYPE from $OMR_TRACKER_DEVICE_IP error ($OMR_TRACKER_LIST_HOSTS6)"
OMR_TRACKER_STATUS_MSG="$OMR_TRACKER_STATUS_MSG and $OMR_TRACKER_TYPE from $OMR_TRACKER_DEVICE_IP6 error ($OMR_TRACKER_LIST_HOSTS6)"
fi
fi
if [ "$OMR_TRACKER_CHECK_QUALITY" = "1" ]; then