2012-05-29 00:30:58 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2010-2012 OpenWrt.org
|
2011-11-09 23:49:28 +00:00
|
|
|
|
|
|
|
SERVICE_USE_PID=1
|
2010-03-14 18:16:29 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2012-05-29 00:30:58 +00:00
|
|
|
. /lib/functions/network.sh
|
2010-03-14 18:16:29 +00:00
|
|
|
|
|
|
|
config_load "dhcp6s"
|
2011-11-09 23:49:28 +00:00
|
|
|
|
2010-03-14 18:16:29 +00:00
|
|
|
local enabled
|
|
|
|
config_get_bool enabled basic enabled 0
|
|
|
|
[ $enabled -eq 0 ] && return 0
|
2011-11-09 23:49:28 +00:00
|
|
|
|
2010-03-14 18:16:29 +00:00
|
|
|
logger starting dhcp6s
|
2011-11-09 23:49:28 +00:00
|
|
|
|
2012-05-29 00:30:58 +00:00
|
|
|
local server_interface server_ifname
|
2010-03-14 18:16:29 +00:00
|
|
|
config_get server_interface basic interface
|
2012-05-29 00:30:58 +00:00
|
|
|
network_get_device server_ifname "$server_interface" || return 1
|
2011-11-09 23:49:28 +00:00
|
|
|
|
2010-03-14 18:16:29 +00:00
|
|
|
local config_file
|
|
|
|
config_get config_file basic config_file
|
|
|
|
|
|
|
|
[ ! -e $config_file ] && return 1
|
2011-11-09 23:49:28 +00:00
|
|
|
|
|
|
|
service_start /usr/sbin/dhcp6s -c $config_file $server_ifname
|
2010-03-14 18:16:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
logger stopping dhcp6s
|
2011-11-09 23:49:28 +00:00
|
|
|
service_stop /usr/sbin/dhcp6s
|
2010-03-14 18:16:29 +00:00
|
|
|
}
|
|
|
|
|