postgresql: update to version 9.0.1
[openwrt/svn-archive/archive.git] / net / dhcp / files / dhcpd.init
1 #!/bin/sh /etc/rc.common
2 START=60
3
4 lease_file=/tmp/dhcpd.leases
5 config_file=/etc/dhcpd.conf
6 pid_file=/var/run/dhcpd.pid
7
8 start() {
9 if [ -e $pid_file ] ; then
10 echo " dhcpd already running with PID `cat $pid_file`"
11 return 1
12 fi
13
14 echo Starting isc-dhcpd
15
16 if [ ! -e $lease_file ]; then
17 echo " Creating $lease_file"
18 touch $lease_file
19 fi
20
21 /usr/sbin/dhcpd -q -cf $config_file -lf $lease_file
22
23 if [ $? -ne 0 ]; then
24 echo " isc-dhcpd failed to start"
25 fi
26 }
27
28 stop() {
29 echo "Stopping isc-dhcpd"
30 if [ -e $pid_file ]; then
31 kill -KILL `cat $pid_file`
32
33 if [ $? -ne 0 ]; then
34 echo " PID " `cat $pid_file` not found
35 echo " Is the DHCP server running?"
36 fi
37
38 rm -f $pid_file
39 else
40 echo " $pid_file not found"
41 fi
42 }