b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | #!/bin/sh /etc/rc.common |
| 2 | |
| 3 | START=65 |
| 4 | |
| 5 | lease_file=/var/dhcpd6.leases |
| 6 | config_file=/etc/dhcpd6.conf |
| 7 | pid_file=/var/run/dhcpd6.pid |
| 8 | |
| 9 | start() { |
| 10 | if [ ! -e $lease_file ]; then |
| 11 | touch $lease_file |
| 12 | fi |
| 13 | |
| 14 | /usr/sbin/dhcpd -q -6 -cf $config_file -lf $lease_file -pf $pid_file $dhcp_ifs |
| 15 | |
| 16 | if [ $? -ne 0 ]; then |
| 17 | return 1 |
| 18 | fi |
| 19 | } |
| 20 | |
| 21 | stop() { |
| 22 | if [ ! -e $pid_file ]; then |
| 23 | return 1 |
| 24 | fi |
| 25 | |
| 26 | kill -9 `cat $pid_file` |
| 27 | |
| 28 | if [ $? -ne 0 ]; then |
| 29 | return 1 |
| 30 | fi |
| 31 | |
| 32 | rm $pid_file |
| 33 | } |