-
Notifications
You must be signed in to change notification settings - Fork 36
Description
- 判断ss状态的文件是:
/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脚本,还是需要有专业人员帮助一下,我只能提供一个思路。