#!/bin/bash # ########################################################################################### # EHU ( /etc/hosts updater ) v0.2 # # code (C) 1999 by rofus # # rofus@mindless.com # # WHAT IS: # # This simple ip-{up-down} script update at every connection (when the ppp daemon starts # # and when is closed) your etc/hosts file with your actual REAL ip and hostname (useful in# # some cases). # # USAGE: # # For usage read carefully the ip-up file! # # # ########################################################################################### ehu () { egrep -E -v ^# /etc/hosts.backdark > /etc/hosts ehudown=$(hostname) hostname $ehudown } if [ -e "/etc/hosts.backdark" ] then ehu else # If the script can't find /etc/hosts.backdark it simply # copy the /etc/hosts and create the file. cp /etc/hosts /etc/hosts.backdark ehu fi