[package] ahcpd: Fix server mode (broken script)
authorGabriel Kerneis <kerneis@pps.jussieu.fr>
Mon, 31 May 2010 12:17:42 +0000 (12:17 +0000)
committerGabriel Kerneis <kerneis@pps.jussieu.fr>
Mon, 31 May 2010 12:17:42 +0000 (12:17 +0000)
Signed-off-by: Gabriel Kerneis <kerneis@pps.jussieu.fr>
SVN-Revision: 21644

ipv6/ahcpd/Makefile
ipv6/ahcpd/files/ahcp.sh

index b1ca537705e37bafdb9dc12f84f0d8b5505ca631..b044e66e2b3762530ccea5ace1210a431639760a 100644 (file)
@@ -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/
index b97bda92548143a32173156dbdb6cfc7cffade26..e77f33723e45db0ccd53367d80e0e719784b30fd 100644 (file)
@@ -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'