3 # chkconfig: 2345 65 35
4 # description: dhcp_probe attempts to discover DHCP and BootP servers on a directly-attached
5 # Ethernet network. A network administrator can use this tool to locate
6 # unauthorized DHCP and BootP servers.
7 # processname: dhcp_probe
8 # pidfile: /var/run/dhcp_probe.pid
9 # config: /etc/dhcp_probe.cf
11 # Provides: dhcp_probe
12 # Required-Start: $network
13 # Required-Stop: $network
14 # Default-Stop: 0 1 2 6
15 # Short-Description: start/stop/restart the dhcp_probe daemon
16 # Description: dhcp_probe attempts to discover DHCP and BootP servers.
19 # Source function library
20 . /etc/rc.d/init.d/functions
23 . /etc/sysconfig/network
25 [ -f /etc/sysconfig/dhcp_probe ] && . /etc/sysconfig/dhcp_probe
28 if [ -f /var/lock/subsys/dhcp_probe ]; then
29 msg_already_running "dhcp_probe"
32 for nic in $INTERFACES; do
33 msg_starting "dhcp_probe on $nic"
34 daemon /usr/sbin/dhcp_probe -p /var/run/dhcp_probe.$nic.pid $nic
36 touch /var/lock/subsys/dhcp_probe
40 if [ ! -f /var/lock/subsys/dhcp_probe ]; then
41 msg_not_running "dhcp_probe"
44 for nic in $INTERFACES; do
45 msg_stopping "dhcp_probe on $nic"
46 killproc --pidfile /var/run/dhcp_probe.$nic.pid dhcp_probe
48 # kill leftovers if an interface was removed from $INTERFACES
49 for file in /var/run/dhcp_probe*pid ; do
50 nic=${file##/var/run/dhcp_probe.}
52 [ -z "$nic" ] && nic="unknown interface"
53 msg_stopping "dhcp_probe on $nic"
54 killproc --pidfile $file dhcp_probe
56 rm -f /var/lock/subsys/dhcp_probe >/dev/null 2>&1
60 for nic in $INTERFACES; do
61 killproc --pidfile /var/run/dhcp_probe.$nic.pid dhcp_probe -HUP
66 for nic in $INTERFACES; do
67 status --pidfile /var/run/dhcp_probe.$nic.pid "dhcp_probe on $nic"
72 if [ ! -f /var/lock/subsys/dhcp_probe ]; then
73 msg_not_running "dhcp_probe"
81 # See how we were called.
99 condrestart|try-restart)
103 msg_usage "$0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"