diff --git a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking index a4c470c9a..8d9056aca 100755 --- a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking +++ b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking @@ -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