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:
parent
6dbf7cc73c
commit
7e07f63967
3 changed files with 23 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue