MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

  • CheckConnection

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

   1 #!/bin/sh
   2 PROG=checkConnection
   3 HOST=host.example.net
   4 ping $HOST -c 5 > /dev/null 
   5 RES=$?
   6 if [ $RES -eq 0 ]; then
   7   logger "$PROG: Ping to $HOST OK"
   8 else
   9   logger "$PROG: Ping to $HOST NOK, running dhclient eth0"
  10   dhclient eth0 -v
  11   # other seervices that may need restarting
  12 fi

On Slackware the logger output should appear on /var/log/messages.

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01