|
CODE:
#!/bin/sh
echo sudo pppoe-start >& /dev/null if [ $? -ne 0 ] ;then echo " Already Connected " echo fi ping -c 2 >& /dev/null if [ $? -eq 0 ] ;then echo " I'm Bound Conneted" echo exit 0 else echo "But not work" # if not work reconnect and adjust the route table sudo pppoe-stop >& /dev/null sudo pppoe-start >& /dev/null echo " Adjusting mount table" sudo route del default sudo route add default ppp0 ping -c 2 >& /dev/null if [ $? -eq 0 ] ;then echo " I'm Sure Connected" exit 0 else echo " Sorry ...Please Try Again" exit 1 fi fi 来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10617542/viewspace-960188/ ,如需转载,请注明出处,否则将追究法律责任。
请登录后发表评论
登录
全部评论
|