From: Roy Marples Date: Fri, 15 Aug 2008 11:06:27 +0000 (+0000) Subject: Don't enforce that keys are space separated X-Git-Tag: v4.0.2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee90dc2257a48b3b8bae93a218d3dcc1bee46aaf;p=thirdparty%2Fdhcpcd.git Don't enforce that keys are space separated --- diff --git a/dhcpcd-hooks/20-resolv.conf b/dhcpcd-hooks/20-resolv.conf index 8a3deab8..e757ddff 100644 --- a/dhcpcd-hooks/20-resolv.conf +++ b/dhcpcd-hooks/20-resolv.conf @@ -25,12 +25,12 @@ build_resolv_conf() # Build the search list search=$(cd "${resolv_conf_dir}"; \ - key_get_value "search" ${interfaces}) + key_get_value "search " ${interfaces}) [ -n "${search}" ] && search="search $(uniqify ${search})\n" # Build the nameserver list srvs=$(cd "${resolv_conf_dir}"; \ - key_get_value "nameserver" ${interfaces}) + key_get_value "nameserver " ${interfaces}) for x in $(uniqify ${srvs}); do servers="${servers}nameserver ${x}\n" done diff --git a/dhcpcd-hooks/50-ntp.conf b/dhcpcd-hooks/50-ntp.conf index 6cf6a2dd..536f14e9 100644 --- a/dhcpcd-hooks/50-ntp.conf +++ b/dhcpcd-hooks/50-ntp.conf @@ -30,7 +30,7 @@ build_ntp_conf() # Build a server list srvs=$(cd "${ntp_conf_dir}"; - key_get_value "server" ${interfaces}) + key_get_value "server " ${interfaces}) if [ -n "${srvs}" ]; then for x in $(uniqify ${srvs}); do servers="${servers}server ${x}\n" diff --git a/dhcpcd-run-hooks.in b/dhcpcd-run-hooks.in index 2bb84bab..66192942 100644 --- a/dhcpcd-run-hooks.in +++ b/dhcpcd-run-hooks.in @@ -44,12 +44,12 @@ key_get_value() shift if type sed >/dev/null 2>&1; then - sed -n "s/^${key} //p" $@ + sed -n "s/^${key}//p" $@ else for x; do while read line; do case "${line}" in - "${key} "*) echo "${line##${key} }";; + "${key}"*) echo "${line##${key}}";; esac done < "${x}" done