daily pastebin goal
71%
SHARE
TWEET

Test connectivity

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