packages/wide-dhcpv6: use new service functions
packages/wide-dhcpv6: use new service functions

git-svn-id: svn://svn.openwrt.org/openwrt/packages@28929 3c298f89-4303-0410-b956-a3cf2f4a3e73

--- a/ipv6/wide-dhcpv6/Makefile
+++ b/ipv6/wide-dhcpv6/Makefile
@@ -1,3 +1,9 @@
+#
+# Copyright (C) 2010-2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
 
 include $(TOPDIR)/rules.mk
 

--- a/ipv6/wide-dhcpv6/files/dhcp6s.init
+++ b/ipv6/wide-dhcpv6/files/dhcp6s.init
@@ -1,4 +1,7 @@
 #!/bin/sh /etc/rc.common 
+# Copyright (C) 2010-2011 OpenWrt.org
+
+SERVICE_USE_PID=1
 
 get_ifname() {
 	local interface=$1
@@ -10,7 +13,6 @@
 }
 
 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
@@ -18,34 +20,28 @@
 	include /lib/network
 
 	config_load "dhcp6s"
-	
+
 	local enabled
 	config_get_bool enabled basic enabled 0
 	[ $enabled -eq 0 ] && return 0
-	
+
 	logger starting dhcp6s
-	
+
 	local server_interface 
 	config_get server_interface basic interface
 	local server_ifname=$(get_ifname "$server_interface")
-	
+
 	local config_file
 	config_get config_file basic config_file
 
 	[ ! -e $config_file ] && return 1
-	
-	/usr/sbin/dhcp6s -c $config_file $server_ifname
-	
-	return 0
-	
+
+	service_start /usr/sbin/dhcp6s -c $config_file $server_ifname
 }
 
 stop() {
-
 	logger stopping dhcp6s
-	kill -TERM `cat /var/run/dhcp6s.pid`
-	return 0
-	
+	service_stop /usr/sbin/dhcp6s
 }
 
 

comments