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

Add option to restart interface if down

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-03-26 20:10:49 +01:00
parent 6dbf7cc73c
commit 7e07f63967
3 changed files with 23 additions and 0 deletions

View file

@ -678,6 +678,14 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
script_alert_down="$(uci -q get omr-tracker.$OMR_TRACKER_INTERFACE.script_alert_down)"
[ -n "$script_alert_down" ] && eval $script_alert_down
restart_down="$(uci -q get omr-tracker.$OMR_TRACKER_INTERFACE.restart_down)"
[ -z "$restart_down" ] && restart_down="$(uci -q get omr-tracker.defaults.restart_down)"
[ "$restart_down" = "1" ] && {
ifdown $OMR_TRACKER_INTERFACE 2>&1 >/dev/null
sleep 5
ifup $OMR_TRACKER_INTERFACE 2>&1 >/dev/null
}
if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ]; then
if [ "$OMR_TRACKER_STATUS_MSG" = "" ]; then
_log "$OMR_TRACKER_INTERFACE down"