From 640e8e5d1b6fa17957fdf875afe61021cbe6cce3 Mon Sep 17 00:00:00 2001 From: jow Date: Sun, 5 Feb 2012 19:05:30 +0000 Subject: [PATCH] [packages_10.03.2] wide-dhcpv6: backport r28929, r29222 git-svn-id: svn://svn.openwrt.org/openwrt/branches/packages_10.03.2@30316 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ipv6/wide-dhcpv6/Makefile | 16 ++++++++++----- .../files/{dhcp6c.conf => dhcp6c.config} | 0 .../files/{dhcp6s.conf => dhcp6s.config} | 0 ipv6/wide-dhcpv6/files/dhcp6s.init | 24 +++++++++------------- 4 files changed, 21 insertions(+), 19 deletions(-) rename ipv6/wide-dhcpv6/files/{dhcp6c.conf => dhcp6c.config} (100%) rename ipv6/wide-dhcpv6/files/{dhcp6s.conf => dhcp6s.config} (100%) diff --git a/ipv6/wide-dhcpv6/Makefile b/ipv6/wide-dhcpv6/Makefile index 54950e4..04f1326 100644 --- a/ipv6/wide-dhcpv6/Makefile +++ b/ipv6/wide-dhcpv6/Makefile @@ -1,9 +1,15 @@ +# +# 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 PKG_NAME:=wide-dhcpv6 PKG_VERSION:=20080615 -PKG_RELEASE:=6.3 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/$(PKG_NAME) @@ -94,11 +100,11 @@ define Package/wide-dhcpv6-client/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/dhcp6c $(1)/usr/sbin $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/dhcp6c.conf $(1)/etc/config/dhcp6c + $(INSTALL_CONF) ./files/dhcp6c.config $(1)/etc/config/dhcp6c $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/dhcp6c.init $(1)/etc/init.d/dhcp6c $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_DATA) ./files/dhcp6c.hotplug $(1)/etc/hotplug.d/iface/40-dhcp6c + $(INSTALL_DATA) ./files/dhcp6c.hotplug $(1)/etc/hotplug.d/iface/40-dhcp6c $(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp6c $(INSTALL_DATA) ./files/dhcp6c-dnsmasq.hotplug $(1)/etc/hotplug.d/dhcp6c/10-dnsmasq $(INSTALL_DATA) ./files/dhcp6c-radvd.hotplug $(1)/etc/hotplug.d/dhcp6c/20-radvd @@ -116,11 +122,11 @@ define Package/wide-dhcpv6-server/install $(INSTALL_DIR) $(1)/etc $(INSTALL_CONF) $(PKG_BUILD_DIR)/dhcp6s.conf.sample $(1)/etc $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/dhcp6s.conf $(1)/etc/config/dhcp6s + $(INSTALL_CONF) ./files/dhcp6s.config $(1)/etc/config/dhcp6s $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/dhcp6s.init $(1)/etc/init.d/dhcp6s $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_DATA) ./files/dhcp6s.hotplug $(1)/etc/hotplug.d/iface/50-dhcp6s + $(INSTALL_DATA) ./files/dhcp6s.hotplug $(1)/etc/hotplug.d/iface/50-dhcp6s endef define Package/wide-dhcpv6-relay/install diff --git a/ipv6/wide-dhcpv6/files/dhcp6c.conf b/ipv6/wide-dhcpv6/files/dhcp6c.config similarity index 100% rename from ipv6/wide-dhcpv6/files/dhcp6c.conf rename to ipv6/wide-dhcpv6/files/dhcp6c.config diff --git a/ipv6/wide-dhcpv6/files/dhcp6s.conf b/ipv6/wide-dhcpv6/files/dhcp6s.config similarity index 100% rename from ipv6/wide-dhcpv6/files/dhcp6s.conf rename to ipv6/wide-dhcpv6/files/dhcp6s.config diff --git a/ipv6/wide-dhcpv6/files/dhcp6s.init b/ipv6/wide-dhcpv6/files/dhcp6s.init index fc0da52..c507659 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