Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Which address do you want to ping to see if you can connect
- pingip='192.168.1.1'
- # Perform the network check and reset if necessary
- /bin/ping -c 2 -I wlan0 $pingip > /dev/null 2> /dev/null
- if [ $? -ge 1 ] ; then
- echo "Network is DOWN."
- /sbin/ifdown wlan0
- sleep 5
- /sbin/ifup --force wlan0
- else
- echo "Network is UP."
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement