1
description "ISC DHCP IPv6 server"
2
author "Stéphane Graber <stgraber@ubuntu.com>"
4
start on runlevel [2345]
5
stop on runlevel [!2345]
8
if [ ! -f /etc/default/isc-dhcp-server ]; then
9
echo "/etc/default/isc-dhcp-server does not exist! - Aborting..."
10
echo "Run 'dpkg-reconfigure isc-dhcp-server' to fix the problem."
14
. /etc/default/isc-dhcp-server
16
if [ -f /etc/ltsp/dhcpd6.conf ]; then
17
CONFIG_FILE=/etc/ltsp/dhcpd6.conf
19
CONFIG_FILE=/etc/dhcp/dhcpd6.conf
21
if [ ! -f $CONFIG_FILE ]; then
22
echo "$CONFIG_FILE does not exist! - Aborting..."
23
echo "Please create and configure $CONFIG_FILE to fix the problem."
28
if ! /usr/sbin/dhcpd -t -q -6 -cf $CONFIG_FILE > /dev/null 2>&1; then
29
echo "dhcpd self-test failed. Please fix the config file."
30
echo "The error was: "
31
/usr/sbin/dhcpd -t -6 -cf $CONFIG_FILE
39
if [ -f /etc/ltsp/dhcpd6.conf ]; then
40
CONFIG_FILE=/etc/ltsp/dhcpd6.conf
42
CONFIG_FILE=/etc/dhcp/dhcpd6.conf
45
. /etc/default/isc-dhcp-server
47
# Allow dhcp server to write lease and pid file
48
mkdir -p /var/run/dhcp-server
49
chown dhcpd:dhcpd /var/run/dhcp-server
50
[ -e /var/lib/dhcp/dhcpd6.leases ] || touch /var/lib/dhcp/dhcpd6.leases
51
chown dhcpd:dhcpd /var/lib/dhcp /var/lib/dhcp/dhcpd6.leases
52
if [ -e /var/lib/dhcp/dhcpd6.leases~ ]; then
53
chown dhcpd:dhcpd /var/lib/dhcp/dhcpd6.leases~
56
exec /usr/sbin/dhcpd -f -q -6 -cf $CONFIG_FILE $INTERFACES