|
Size: 647
Comment:
|
Size: 713
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 12: | Line 12: |
| HOST=www.google.com | HOST=host.example.net |
| Line 16: | Line 16: |
| logger "$PROG: Ping OK" | logger "$PROG: Ping to $HOST OK" |
| Line 18: | Line 18: |
| logger "$PROG: Ping NOK, running dhclient eth0" | logger "$PROG: Ping to $HOST NOK, running dhclient eth0" |
| Line 20: | Line 20: |
| # other seervices that may need restarting |
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 /<folder>/checkConnection.sh
- crontab -e
* * * * * /<folder>/checkConnection.sh
On Slackware the logger output should apper on /var/log/messages.
