1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
This commit is contained in:
suyuan 2024-01-19 01:43:23 +08:00 committed by GitHub
commit 3fb2013eaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 42 additions and 34 deletions

View file

@ -317,7 +317,7 @@ while true; do
OMR_TRACKER_DEVICE_GATEWAY=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | grep -m 1 default | awk '/via/ {print $3}' | tr -d "\n")
fi
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then
OMR_TRACKER_DEVICE_GATEWAY=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | awk '/via/ {print $3}' | tr -d "\n")
OMR_TRACKER_DEVICE_GATEWAY=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | awk '/via/ {print $3;exit}' | tr -d "\n")
fi
fi
if ([ "$OMR_TRACKER_IPV6" = "1" ] || [ "$OMR_TRACKER_IPV6" = "auto" ] || [ -z "$OMR_TRACKER_IPV6" ]) && ([ "$OMR_TRACKER_FAMILY" = "ipv6" ] || [ "$OMR_TRACKER_FAMILY" = "ipv4ipv6" ]); then

View file

@ -174,8 +174,8 @@ _check_master() {
echo -e "Subject: $OMR_SYSNAME: Server ${name} (${ip}) is UP\n. The reason is \"$OMR_TRACKER_STATUS_MSG\"." | sendmail $(uci -q get mail.default.to)
fi
}
script_alert_down="$(uci -q get omr-tracker.proxy.script_alert_up)"
[ -n "$script_alert_down" ] && eval $script_alert_up
script_alert_up="$(uci -q get omr-tracker.proxy.script_alert_up)"
[ -n "$script_alert_up" ] && eval $script_alert_up
count=$((count+1))
else
logger -t "OMR-Tracker-Server" "Master server ${name} down ($ip)"
@ -317,8 +317,8 @@ _check_backup() {
echo -e "Subject: $OMR_SYSNAME: Server ${name} (${ip}) is UP\n. The reason is \"$OMR_TRACKER_STATUS_MSG\"." | sendmail $(uci -q get mail.default.to)
fi
}
script_alert_down="$(uci -q get omr-tracker.proxy.script_alert_up)"
[ -n "$script_alert_down" ] && eval $script_alert_up
script_alert_up="$(uci -q get omr-tracker.proxy.script_alert_up)"
[ -n "$script_alert_up" ] && eval $script_alert_up
count=$((count+1))
else
uci -q batch <<-EOF >/dev/null
@ -374,7 +374,6 @@ interval=${OMR_TRACKER_INTERVAL:-10}
intervaltries=${OMR_TRACKER_INTERVAL_TRIES:-2}
retry=${OMR_TRACKER_TRIES:-4}
waittest=${OMR_TRACKER_WAIT_TEST:-0}
while true; do
server_ping=false
config_load openmptcprouter