mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix restart MLVPN when not here
This commit is contained in:
parent
129bb12930
commit
b14c380d0a
1 changed files with 10 additions and 6 deletions
|
@ -191,10 +191,11 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
|
|||
mail_alert="$(uci -q get omr-tracker.$OMR_TRACKER_INTERFACE.mail_alert)"
|
||||
[ -z "$mail_alert" ] && mail_alert="$(uci -q get omr-tracker.defaults.mail_alert)"
|
||||
[ "$mail_alert" = "1" ] && {
|
||||
OMR_SYSNAME="$(uci -q get system.@system[0].hostname)"
|
||||
if [ "$OMR_TRACKER_STATUS_MSG" = "" ]; then
|
||||
echo -e "Subject: OpenMPTCProuter: $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) is down\n\nOpenMPTCProuter detected a connection failure of $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE)." | sendmail $(uci -q get mail.default.to)
|
||||
echo -e "Subject: $OMR_SYSNAME: $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) is down\n\nConnection failure of $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) detected." | sendmail $(uci -q get mail.default.to)
|
||||
else
|
||||
echo -e "Subject: OpenMPTCProuter: $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) is down\n\nOpenMPTCProuter detected a connection failure of $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE). The reason is \"$OMR_TRACKER_STATUS_MSG\"." | sendmail $(uci -q get mail.default.to)
|
||||
echo -e "Subject: $OMR_SYSNAME: $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) is down\n\nConnection failure of $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) detected. The reason is \"$OMR_TRACKER_STATUS_MSG\"." | sendmail $(uci -q get mail.default.to)
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -278,7 +279,10 @@ fi
|
|||
if [ "$OMR_TRACKER_PREV_STATUS" != "" ] && [ "$OMR_TRACKER_PREV_STATUS" != "$OMR_TRACKER_STATUS" ]; then
|
||||
mail_alert="$(uci -q get omr-tracker.$OMR_TRACKER_INTERFACE.mail_alert)"
|
||||
[ -z "$mail_alert" ] && mail_alert="$(uci -q get omr-tracker.defaults.mail_alert)"
|
||||
[ "$mail_alert" = "1" ] && echo -e "Subject: OpenMPTCProuter: $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) is up\n\nOpenMPTCProuter detected that connection $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) is up again." | sendmail $(uci -q get mail.default.to)
|
||||
[ "$mail_alert" = "1" ] && {
|
||||
OMR_SYSNAME="$(uci -q get system.@system[0].hostname)"
|
||||
echo -e "Subject: $OMR_SYSNAME: $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) is up\n\nDetected that connection $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE) is up again." | sendmail $(uci -q get mail.default.to)
|
||||
}
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state='up'
|
||||
uci -q commit openmptcprouter
|
||||
dns_flush
|
||||
|
@ -474,18 +478,18 @@ if [ "$(pgrep ss-redir)" = "" ] && [ "$(pgrep ss-local)" = "" ] && [ "$(uci -q g
|
|||
/etc/init.d/shadowsocks-libev restart
|
||||
sleep 5
|
||||
fi
|
||||
if [ "$(pgrep glorytun)" = "" ] && [ "$(uci -q get glorytun.vpn.enabled)" = "1" ]; then
|
||||
if [ "$(pgrep glorytun)" = "" ] && [ "$(uci -q get glorytun.vpn.enabled)" = "1" ] && [ -f /etc/init.d/glorytun ]; then
|
||||
_log "Can't find Glorytun, restart it..."
|
||||
/etc/init.d/glorytun restart
|
||||
/etc/init.d/glorytun-udp restart
|
||||
sleep 5
|
||||
fi
|
||||
if [ "$(pgrep openvpn)" = "" ] && [ "$(uci -q get openvpn.omr.enabled)" != "0" ]; then
|
||||
if [ "$(pgrep openvpn)" = "" ] && [ "$(uci -q get openvpn.omr.enabled)" != "0" ] && [ -f /etc/init.d/openvpn ]; then
|
||||
_log "Can't find OpenVPN, restart it..."
|
||||
/etc/init.d/openvpn restart
|
||||
sleep 5
|
||||
fi
|
||||
if [ "$(pgrep mlvpn)" = "" ] && [ "$(uci -q get mlvpn.general.enable)" != "0" ]; then
|
||||
if [ "$(pgrep mlvpn)" = "" ] && [ "$(uci -q get mlvpn.general.enable)" = "1" ] && [ -f /etc/init.d/mlvpn ]; then
|
||||
_log "Can't find MLVPN, restart it..."
|
||||
/etc/init.d/mlvpn restart
|
||||
sleep 5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue