From 59fcb0e89a7575b7ac214763497fc9992920f36f Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 9 Nov 2011 23:49:28 +0000 Subject: [PATCH] packages/wide-dhcpv6: use new service functions git-svn-id: svn://svn.openwrt.org/openwrt/packages@28929 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ipv6/wide-dhcpv6/Makefile | 6 ++++++ ipv6/wide-dhcpv6/files/dhcp6s.init | 24 ++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ipv6/wide-dhcpv6/Makefile b/ipv6/wide-dhcpv6/Makefile index 051ed3850..9a869b332 100644 --- 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 diff --git a/ipv6/wide-dhcpv6/files/dhcp6s.init b/ipv6/wide-dhcpv6/files/dhcp6s.init index fc0da52e9..c50765974 100644 --- 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 @@ get_ifname() { } 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,33 +20,27 @@ start() { 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 } -- 2.11.0