diff options
author | Nicolas Thill <nico@openwrt.org> | 2011-11-08 22:47:54 +0000 |
---|---|---|
committer | Nicolas Thill <nico@openwrt.org> | 2011-11-08 22:47:54 +0000 |
commit | f4dacc850c10531e86f200333bc212b778c29066 (patch) | |
tree | 9d74d4b60c4530bf231d960958ef93ef54d6948a /package/base-files-network/files/lib/network/config.sh | |
parent | b7b56df70790aa17eed47c31a3a588a557f64d41 (diff) | |
download | mtk-20170518-f4dacc850c10531e86f200333bc212b778c29066.zip mtk-20170518-f4dacc850c10531e86f200333bc212b778c29066.tar.gz mtk-20170518-f4dacc850c10531e86f200333bc212b778c29066.tar.bz2 |
package/base-files-network: use new service wrappers
SVN-Revision: 28866
Diffstat (limited to 'package/base-files-network/files/lib/network/config.sh')
-rwxr-xr-x | package/base-files-network/files/lib/network/config.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/package/base-files-network/files/lib/network/config.sh b/package/base-files-network/files/lib/network/config.sh index 74810e4..da45089 100755 --- a/package/base-files-network/files/lib/network/config.sh +++ b/package/base-files-network/files/lib/network/config.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org # DEBUG="echo" @@ -368,7 +368,9 @@ setup_interface() { dhcp) # kill running udhcpc instance local pidfile="/var/run/dhcp-${iface}.pid" - service_kill udhcpc "$pidfile" + + SERVICE_PID_FILE="$pidfile" \ + service_stop udhcpc local ipaddr netmask hostname proto1 clientid vendorid broadcast reqopts config_get ipaddr "$config" ipaddr @@ -393,7 +395,8 @@ setup_interface() { [ "$proto1" != "$proto" ] && append dhcpopts "-n -q" || append dhcpopts "-O rootpath -R &" [ "$broadcast" = 1 ] && broadcast="-O broadcast" || broadcast= - $DEBUG eval udhcpc -t 0 -i "$iface" \ + SERVICE_PID_FILE="$pidfile" \ + service_start /sbin/udhcpc -t 0 -i "$iface" \ ${ipaddr:+-r $ipaddr} \ ${hostname:+-H $hostname} \ ${clientid:+-c $clientid} \ @@ -426,8 +429,8 @@ stop_interface_dhcp() { remove_dns "$config" - local pidfile="/var/run/dhcp-${ifname}.pid" - service_kill udhcpc "$pidfile" + SERVICE_PID_FILE="/var/run/dhcp-${ifname}.pid" \ + service_stop /sbin/udhcpc uci -P /var/state revert "network.$config" } |