diff options
author | Nicolas Thill <nico@openwrt.org> | 2011-11-11 13:23:29 +0000 |
---|---|---|
committer | Nicolas Thill <nico@openwrt.org> | 2011-11-11 13:23:29 +0000 |
commit | 348347ce41e6704f1c66a608531d10cb7b78d729 (patch) | |
tree | 91aa269eab4f78d56136f3edb417190d619b1d5d /package/base-files-network/files/lib/network/config.sh | |
parent | 1cdd762f908a29c1f577ccdb5c1620a62e452a30 (diff) | |
download | mtk-20170518-348347ce41e6704f1c66a608531d10cb7b78d729.zip mtk-20170518-348347ce41e6704f1c66a608531d10cb7b78d729.tar.gz mtk-20170518-348347ce41e6704f1c66a608531d10cb7b78d729.tar.bz2 |
package/base-files-network: fix udhcpc issues introduced in r28866 (closes: #10383)
SVN-Revision: 28942
Diffstat (limited to 'package/base-files-network/files/lib/network/config.sh')
-rwxr-xr-x | package/base-files-network/files/lib/network/config.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/package/base-files-network/files/lib/network/config.sh b/package/base-files-network/files/lib/network/config.sh index da45089..feeaa2f 100755 --- a/package/base-files-network/files/lib/network/config.sh +++ b/package/base-files-network/files/lib/network/config.sh @@ -370,7 +370,7 @@ setup_interface() { local pidfile="/var/run/dhcp-${iface}.pid" SERVICE_PID_FILE="$pidfile" \ - service_stop udhcpc + service_stop /sbin/udhcpc local ipaddr netmask hostname proto1 clientid vendorid broadcast reqopts config_get ipaddr "$config" ipaddr @@ -386,15 +386,21 @@ setup_interface() { $DEBUG ifconfig "$iface" "$ipaddr" ${netmask:+netmask "$netmask"} # additional request options - local opt dhcpopts + local opt dhcpopts daemonize for opt in $reqopts; do append dhcpopts "-O $opt" done # don't stay running in background if dhcp is not the main proto on the interface (e.g. when using pptp) - [ "$proto1" != "$proto" ] && append dhcpopts "-n -q" || append dhcpopts "-O rootpath -R &" + [ "$proto1" != "$proto" ] && { + append dhcpopts "-n -q" + } || { + append dhcpopts "-O rootpath -R" + daemonize=1 + } [ "$broadcast" = 1 ] && broadcast="-O broadcast" || broadcast= + SERVICE_DAEMONIZE=$daemonize \ SERVICE_PID_FILE="$pidfile" \ service_start /sbin/udhcpc -t 0 -i "$iface" \ ${ipaddr:+-r $ipaddr} \ |