From: Gabriel Kerneis Date: Mon, 31 May 2010 12:17:42 +0000 (+0000) Subject: [package] ahcpd: Fix server mode (broken script) X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1448caa3f0d4be05a82f0713c7f00de3ea6dcb70;p=openwrt%2Fsvn-archive%2Farchive.git [package] ahcpd: Fix server mode (broken script) Signed-off-by: Gabriel Kerneis SVN-Revision: 21644 --- diff --git a/ipv6/ahcpd/Makefile b/ipv6/ahcpd/Makefile index b1ca537705..b044e66e2b 100644 --- a/ipv6/ahcpd/Makefile +++ b/ipv6/ahcpd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ahcpd PKG_VERSION:=0.51 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.pps.jussieu.fr/~jch/software/files/ diff --git a/ipv6/ahcpd/files/ahcp.sh b/ipv6/ahcpd/files/ahcp.sh index b97bda9254..e77f33723e 100644 --- a/ipv6/ahcpd/files/ahcp.sh +++ b/ipv6/ahcpd/files/ahcp.sh @@ -17,10 +17,20 @@ append_parm() { append args "$switch $_loctmp" } -append_args() { +append_stmt() { local name="$1" local switch="$2" - append args "$switch $name" + append args "-C '$switch $name'" +} + +append_opt_stmt() { + local section="$1" + local option="$2" + local switch="$3" + local _loctmp + config_get _loctmp "$section" "$option" + [ -z "$_loctmp" ] && return 0 + append args "-C '$switch $_loctmp'" } ahcp_addif() { @@ -32,15 +42,11 @@ ahcp_addif() { ahcp_server() { local cfg="$1" - append args "-C '" - - append_parm "$cfg" 'mode' 'mode' - append_parm "$cfg" 'lease_dir' 'lease-dir' - config_list_foreach "$cfg" 'prefix' append_args 'prefix' - config_list_foreach "$cfg" 'name_server' append_args 'name-server' - config_list_foreach "$cfg" 'ntp_server' append_args 'ntp-server' - - append args ' ' "'" + append_opt_stmt "$cfg" 'mode' 'mode' + append_opt_stmt "$cfg" 'lease_dir' 'lease-dir' + config_list_foreach "$cfg" 'prefix' append_stmt 'prefix' + config_list_foreach "$cfg" 'name_server' append_stmt 'name-server' + config_list_foreach "$cfg" 'ntp_server' append_stmt 'ntp-server' append_parm "$cfg" 'id_file' '-i' append_parm "$cfg" 'log_file' '-L'