= Check connection = Simple script to check connection to a host, that in case of failure asks for new IP address through DHCP. Add entry to crond of account with privileges to get address through '''dhclient''': * chmod 755 //checkConnection.sh * crontab -e * * * * * * //checkConnection.sh {{{#!highlight bash #!/bin/sh PROG=checkConnection HOST=host.example.net ping $HOST -c 5 > /dev/null RES=$? if [ $RES -eq 0 ]; then logger "$PROG: Ping to $HOST OK" else logger "$PROG: Ping to $HOST NOK, running dhclient eth0" dhclient eth0 -v # other seervices that may need restarting fi }}} On Slackware the logger output should appear on '''/var/log/messages'''.