diff options
Diffstat (limited to 'net-scripts/net.modules.d/udhcpc')
-rw-r--r-- | net-scripts/net.modules.d/udhcpc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net-scripts/net.modules.d/udhcpc b/net-scripts/net.modules.d/udhcpc index 69598e3..a0661a0 100644 --- a/net-scripts/net.modules.d/udhcpc +++ b/net-scripts/net.modules.d/udhcpc @@ -43,8 +43,10 @@ udhcpc_stop() { local ifvar=$( bash_variable "${iface}" ) d="dhcp_${ifvar}" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " - if [[ " ${!d} " == *" release "* ]]; then + if [[ ${d} == *" release "* ]]; then kill -s USR2 "${pid}" &>/dev/null [[ -f "/var/cache/dhcp-${iface}.lease" ]] \ && rm "/var/cache/dhcp-${iface}.lease" @@ -75,8 +77,10 @@ udhcpc_start() { opts="${!opts}" d="dhcp_${ifvar}" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " - if [[ " ${!d} " != *" nosendhost "* ]]; then + if [[ " ${d} " != *" nosendhost "* ]]; then if [[ ! " ${opts}" =~ " -([hH] |-hostname=)" ]]; then local hname=$( hostname ) [[ -n ${hname} && ${hname} != "(none)" && ${hname} != "localhost" ]] \ |