Size: 647
Comment:
|
← Revision 5 as of 2013-10-02 20:02:22 ⇥
Size: 714
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 | |
Line 23: | Line 24: |
On Slackware the logger output should apper on '''/var/log/messages'''. | On Slackware the logger output should appear on '''/var/log/messages'''. |
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 appear on /var/log/messages.