diff options
author | 2005-12-06 12:28:25 +0000 | |
---|---|---|
committer | 2005-12-06 12:28:25 +0000 | |
commit | f62636483b16222c394fa17c635d74017cf215ba (patch) | |
tree | 22039adb2bfc850dd02b1a2508f5f0c975b56f91 /net-scripts/net.modules.d/dhcpcd | |
parent | fix openvz /proc handling; cleanup (diff) | |
download | baselayout-vserver-f62636483b16222c394fa17c635d74017cf215ba.tar.gz baselayout-vserver-f62636483b16222c394fa17c635d74017cf215ba.tar.bz2 baselayout-vserver-f62636483b16222c394fa17c635d74017cf215ba.zip |
Importing latest baselayout/trunk changes. Merging revision 1773.
svn path=/baselayout-vserver/trunk/; revision=160
Diffstat (limited to 'net-scripts/net.modules.d/dhcpcd')
-rw-r--r-- | net-scripts/net.modules.d/dhcpcd | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/net-scripts/net.modules.d/dhcpcd b/net-scripts/net.modules.d/dhcpcd index 9d8aa14..70a6bcc 100644 --- a/net-scripts/net.modules.d/dhcpcd +++ b/net-scripts/net.modules.d/dhcpcd @@ -52,7 +52,7 @@ dhcpcd_get_vars() { # Returns 0 (true) when a DHCP address dropped # otherwise return 1 dhcpcd_stop() { - local iface=$1 count signal pidfile="/var/run/dhcpcd-$1.pid" opts + local iface=$1 count signal pidfile="/var/run/dhcpcd-$1.pid" d [[ ! -f ${pidfile} ]] && return 0 @@ -60,9 +60,11 @@ dhcpcd_stop() { local pid=$( < "${pidfile}" ) local ifvar=$( bash_variable "${iface}" ) - opts="dhcp_${ifvar}" + d="dhcp_${ifvar}" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " - if [[ " ${!opts} " == *" release "* ]]; then + if [[ ${d} == *" release "* ]]; then signal="HUP" else signal="TERM" @@ -91,10 +93,12 @@ dhcpcd_start() { # Map some generic options to dhcpcd d="dhcp_${ifvar}" - [[ " ${d} " == *" nodns "* ]] && opts="${opts} -R" - [[ " ${d} " == *" nontp "* ]] && opts="${opts} -N" - [[ " ${d} " == *" nonis "* ]] && opts="${opts} -Y" - [[ " ${d} " == *" nogateway "* ]] && opts="${opts} -G" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " + [[ ${d} == *" nodns "* ]] && opts="${opts} -R" + [[ ${d} == *" nontp "* ]] && opts="${opts} -N" + [[ ${d} == *" nonis "* ]] && opts="${opts} -Y" + [[ ${d} == *" nogateway "* ]] && opts="${opts} -G" # We transmit the hostname by default:q if [[ " ${d} " != *" nosendhost "* && " ${opts} " != *" -h "* ]]; then |