Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- STRING="Connection loss..."
- MODEMDEV="/dev/ttyUSB0'
- ping -c 2 -s 10 -q 8.8.8.8 > /dev/null
- if [ $? = 1 ]; then
- ping -c 6 -s 10 -q 8.8.4.4 > /dev/null
- if [ $? = 1 ]; then
- logger $STRING
- echo -ne "AT+CFUN=1,0\r" > $MODEMDEV
- sleep 3
- echo -ne "AT+CFUN=1,1\r" > $MODEMDEV
- else
- echo "Connection OK." >/dev/null
- fi
- else
- echo "Connection OK." >/dev/null
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement