fcgi: moved to github
[openwrt.org/packages.git] / ipv6 / wide-dhcpv6 / files / dhcp6s.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh /etc/rc.common
# Copyright (C) 2010-2012 OpenWrt.org

SERVICE_USE_PID=1

start() {
	[ ! -e /etc/dhcp6sctlkey ] && `dd if=/dev/urandom count=1 2> /dev/null | md5sum | cut -d" " -f1 > /etc/dhcp6sctlkey`

	[ -e /var/run/dhcp6s.pid ] && return 0

	. /lib/functions/network.sh

	config_load "dhcp6s"

	local enabled
	config_get_bool enabled basic enabled 0
	[ $enabled -eq 0 ] && return 0

	logger starting dhcp6s

	local server_interface server_ifname
	config_get server_interface basic interface
	network_get_device server_ifname "$server_interface" || return 1

	local config_file
	config_get config_file basic config_file

	[ ! -e $config_file ] && return 1

	service_start /usr/sbin/dhcp6s -c $config_file $server_ifname
}

stop() {
	logger stopping dhcp6s
	service_stop /usr/sbin/dhcp6s
}


comments