1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 11:01:50 +00:00

Restart shadowsocks or VPN when needed

This commit is contained in:
Ycarus 2018-12-15 21:33:58 +01:00
parent 5150664c78
commit 24ab73cdb8

View file

@ -366,6 +366,29 @@ fi
fi
}
# If a service is down, force restart it
if [ "$(pgrep ss-redir)" = "" ] && [ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "0" ]; then
_log "Can't find Shadowsocks, restart it..."
/etc/init.d/shadowsocks-libev restart
sleep 10
fi
if [ "$(pgrep glorytun)" = "" ] && [ "$(uci -q get glorytun.vpn.enabled)" = "1" ]; then
_log "Can't find Glorytun, restart it..."
/etc/init.d/glorytun restart
/etc/init.d/glorytun-udp restart
sleep 10
fi
if [ "$(pgrep openvpn)" = "" ] && [ "$(uci -q get openvpn.omr.enabled)" != "0" ]; then
_log "Can't find OpenVPN, restart it..."
/etc/init.d/openvpn restart
sleep 10
fi
if [ "$(pgrep mlvpn)" = "" ] && [ "$(uci -q get mlvpn.general.enable)" != "0" ]; then
_log "Can't find MLVPN, restart it..."
/etc/init.d/mlvpn restart
sleep 10
fi
if [ "$(uci -q show openmptcprouter | grep get_config=\'1\')" != "" ] || [ "$(uci -q show openmptcprouter | grep admin_error=\'1\')" != "" ]; then
/etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1
sleep 5