Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if [ -x /usr/bin/fping ]; then
- `/usr/bin/fping -c1 -i1 -p1 -t5000 -q ADDRESS &> /dev/null`
- #if errorlevel 1/2 fail... 0=allgood 1=icmp-unreach 2=dnsfail
- if [ $? != "0" ];
- then
- echo FAIL 1/2 : Checking another...
- #check another one just in case...
- `/usr/bin/fping -c1 -i1 -p1 -t5000 -q ADDRESS &> /dev/null`
- if [ $? != "0" ];
- then
- echo FAIL 2/2 : Restarting pppd >&2
- poff dsl-provider
- /usr/bin/killall -9 pppd
- #pppd call dsl-provider
- pon dsl-provider
- else
- echo Second OK!
- exit 0
- fi
- else
- echo First OK!
- exit 0
- fi
- else
- echo no fping!
- exit 0
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement