2018-10-08 09:00:07 +08:00

18 lines
388 B
Bash
Executable File

#!/bin/sh
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
/usr/bin/ssr-check www.google.com 80 3 1
if [ "$?" == "0" ]; then
echo "$LOGTIME ShadowsocksR No Problem."
else
/usr/bin/ssr-check www.baidu.com 80 3 1
if [ "$?" == "0" ]; then
echo "$LOGTIME Problem decteted, restarting ShadowsocksR..."
/etc/init.d/shadowsocksr restart
else
echo "$LOGTIME Network Problem. Do nothing."
fi
fi