packages/net/dhcp4/files/dhcpd6.init

38 lines
648 B
Plaintext
Raw Normal View History

#!/bin/sh /etc/rc.common
START=65
lease_file=/var/dhcpd6.leases
config_file=/etc/dhcpd6.conf
pid_file=/var/run/dhcpd6.pid
start() {
echo Starting isc-dhcpd
if [ ! -e $lease_file ]; then
echo " Creating $lease_file"
touch $lease_file
fi
/usr/sbin/dhcpd -q -6 -cf $config_file -lf $lease_file -pf $pid_file
if [ $? -ne 0 ]; then
echo " isc-dhcpd failed to start"
fi
}
stop() {
echo Stopping isc-dhcpd
if [ -e $pid_file ]; then
kill -9 `cat $pid_file`
if [ $? -ne 0 ]; then
echo " PID " `cat $pid_file` not found
echo " Is the DHCP server running?"
fi
rm $pid_file
else
echo " $pid_file not found"
fi
}