*** From dhcp-server -- To unsubscribe, see the end of this message. ***

Here's the test method that I implemented Sat nite:  One way to do this
is to use the bootp client that comes with redhat linux (assuming you
only need to test the basic functionality of the dhcp server).

This script runs periodically on B, to test the dhcp server A and to turn
on B's dhcp if bootp fails (or to turn off B's dhcp if bootp succeeds).
Another script also runs periodically to copy the dhcpd.conf and leases
files from the dhcp server.

# load status function
. /etc/rc.d/init.d/functions

# define some vars
DEV=eth0
RIF="--returniffail"
NOMESSAGE="Bootp failed."
YESMESSAGE="Bootp succeeded."
TMPFILE=/tmp/bootp-results.$$
BOOTPC=/sbin/bootpc
IFCONFIG='echo ifconfig'
ROUTE='echo route'
BINHOST='echo hostname'
RCONF=/tmp/resolv.conf
EHOSTS=/tmp/hosts
LHOSTS=/dev/null
ASKSERVER="18.27.58.17"
TW="--timeoutwait 30"

# Perform the bootp client attempt
if ${BOOTPC} --dev ${DEV} --server ${ASKSERVER} ${RIF} ${TW} > ${TMPFILE}

then # bootpc succeeded and got an ip num
  rm -f ${TMPFILE}
  echo ${YESMESSAGE}
  # if dhcpd is running, stop it.
  status /usr/sbin/dhcpd && /etc/rc.d/init.d/dhcpd stop
else # bootpc failed to get an ip num
  echo ${NOMESSAGE}
  # if dhcpd is not running, start it.
  status /usr/sbin/dhcpd || /etc/rc.d/init.d/dhcpd start
fi
exit 0

--

Sincerely,
Leo Wierzbowski

http://grove.ufl.edu/~leo/

"The Alliance is purely defensive in purpose: none of its
 weapons will ever be used except in self-defence ..."
 (NATO New Strategic Concept, Nov 1991,
 http://www.vm.ee/nato/docu/comm/c911107a.htm)

 "The University of Florida does not endorse or
 disendorse the content of this document.
 Everything is the author's private opinion."




------------------------------------------------------------------------------
To unsubscribe from this list, please visit http://www.fugue.com/dhcp/lists
If you are without web access, or if you are having trouble with the web page,
please send mail to [EMAIL PROTECTED]   Please try to use the web
page first - it will take a long time for your request to be processed by hand.
------------------------------------------------------------------------------

Reply via email to