-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于检测ss状态并自动重新连接的一点思路。 #19
Comments
自力更生写了一个脚本 #!/bin/sh alias echo_date1='echo $(date +%Y年%m月%d日\ %X)' get_china_status(){ get_foreign_status(){ get_china_status echo $log1 |
#!/bin/sh alias echo_date1='echo $(date +%Y年%m月%d日\ %X)' get_china_status(){ get_foreign_status(){ get_china_status echo $log1 |
我写好了一个能用的了 |
/jffs/koolshare/scripts/ss_status.sh
#===================================================================
#!/bin/sh
alias echo_date1='echo $(date +%Y年%m月%d日\ %X)'
export KSROOT=/jffs/koolshare
source $KSROOT/scripts/base.sh
eval
dbus export ss_
date=
echo_date1
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
get_china_status(){
wget -4 --spider --quiet --tries=2 --timeout=2 www.baidu.com
if [ "$?" == "0" ]; then
log2='国内链接 【'$LOGTIME'】 ✓'
else
log2='国内链接 【'$LOGTIME'】 X'
fi
}
get_foreign_status(){
wget -4 --spider --quiet --tries=2 --timeout=2 www.google.com.tw
if [ "$?" == "0" ]; then
log1='国外链接 【'$LOGTIME'】 ✓'
else
log1='国外链接 【'$LOGTIME'】 X'
fi
}
get_china_status
get_foreign_status
http_response "$log1@@$log2"
#==================================================================
需要实现的操作是如果国外连接状态中有X就去执行
/jffs/koolshare/scripts# ss_config.sh start
个人以为这个检测每2分钟做一次就好。
但是我也不会写sh脚本,还是需要有专业人员帮助一下,我只能提供一个思路。
The text was updated successfully, but these errors were encountered: