SHARE
TWEET
Test connectivity
a guest
Jul 3rd, 2015
224
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #!/bin/bash
- # FILENAME: /usr/bin/wirelesstest
- # note the backticks in the next line
- # original source http://ubuntuforums.org/showthread.php?t=707662&p=4405714#post4405714
- # can be modified exponentially to add more tests and resolutions like echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
- # or route add default gw 192.168.0.1 wlan0
- # add to desired path and make executeable then edit roots crontab with sudo crontab -e
- # add the line */5 * * * * bash /usr/bin/wirelesstest
- # this will run the test every 5 mins if the ping command works fine then it exits else it
- #restarts network-manager
- if ! `ping -c3 192.168.1.1 >/dev/null 2>&1` ; then
- service network-manager restart
- fi
- exit 0
RAW Paste Data
