Some useful tools I've made to ease living with my Raspberry Pi.
Small and useful scripts for bash.
A configurable script that checks for network connectivity. After failure it does the following:
- Retry connection a configurable number of times.
- Reset the configured network device and try to renew the IP address using the DHCP client.
- (optional)Reboot the machine.
The script needs to be run periodically using crontab or any other scheduler.
Edit your /etc/crontab file and add the following line. Replace the location with your location of the script and the time of execution to whatever suits.
*/10 * * * * root bash /home/pi/bin/network-check.sh