PPPD 拨号上网监控脚本

#!/bin/sh
pppd call wcdma &
while true
do
    sleep 60
    COUNT3=$(ps -ef |grep pppd call wcdma |grep -v "grep" |wc -l)
    if [ $COUNT3 -eq 0 ]; then
        time=$(date "+%Y-%m-%d %H:%M:%S")
        echo ${time}":pppd is down" >> /home/log
        pppd call wcdma &
        time1=$(date "+%Y-%m-%d %H:%M:%S")
        echo ${time1}":pppd is up" >> /home/log
    fi
done

你可能感兴趣的:(linux,服务器,运维)