[package] add ISC DHCP4 4.2.3-P1
[packages.git] / net / dhcp4 / files / dhcpd6.init
1 #!/bin/sh /etc/rc.common
2 START=65
3
4 lease_file=/var/dhcpd6.leases
5 config_file=/etc/dhcpd6.conf
6 pid_file=/var/run/dhcpd6.pid
7
8 start() {
9         echo Starting isc-dhcpd
10
11         if [ ! -e $lease_file ]; then
12                 echo "  Creating $lease_file"
13                 touch $lease_file
14         fi
15         
16         /usr/sbin/dhcpd -q -6 -cf $config_file -lf $lease_file -pf $pid_file
17         
18         if [ $? -ne 0 ]; then
19                 echo "  isc-dhcpd failed to start"
20         fi
21 }
22
23 stop() {
24         echo Stopping isc-dhcpd
25         if [ -e $pid_file ]; then
26                 kill -9 `cat $pid_file`
27
28                 if [ $? -ne 0 ]; then
29                         echo "  PID " `cat $pid_file` not found
30                         echo "  Is the DHCP server running?"
31                 fi
32         
33                 rm $pid_file
34         else
35                 echo "  $pid_file not found"
36         fi
37 }