aboutsummaryrefslogtreecommitdiff
path: root/net/isc-dhcp/files/dhclient6.init
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2023-07-25 15:48:14 -0600
committerPhilip Prindeville <philipp@redfish-solutions.com>2023-07-25 15:55:14 -0600
commit8a52c2b7428c59dc31aa9815c47f8c269bae2a11 (patch)
tree644426aa5ca75793a8cfdea720cfed9c05028b96 /net/isc-dhcp/files/dhclient6.init
parent971d326768b962dc4acdea181ae58b72c609e119 (diff)
isc-dhcp: use network_get_device in client scripts
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Diffstat (limited to 'net/isc-dhcp/files/dhclient6.init')
-rw-r--r--net/isc-dhcp/files/dhclient6.init26
1 files changed, 13 insertions, 13 deletions
diff --git a/net/isc-dhcp/files/dhclient6.init b/net/isc-dhcp/files/dhclient6.init
index 630c3f25f..dd1a095b1 100644
--- a/net/isc-dhcp/files/dhclient6.init
+++ b/net/isc-dhcp/files/dhclient6.init
@@ -8,23 +8,23 @@ pid_file=/var/run/dhclient6.pid
script_file=/usr/sbin/dhclient-script
start() {
- /usr/sbin/dhclient -q -nw -6 -cf $config_file -lf $lease_file -pf $pid_file -sf $script_file `/sbin/uci get network.wan.ifname`
-
- if [ $? -ne 0 ]; then
- return 1
- fi
+ local ifname
+
+ . /lib/functions/network.sh
+
+ network_get_device ifname "wan" || return 1
+
+ /usr/sbin/dhclient -q -nw -6 -cf $config_file -lf $lease_file -pf $pid_file -sf $script_file $ifname
+
+ [ $? -eq 0 ] || return 1
}
stop() {
- if [ ! -e $pid_file ]; then
- return 1
- fi
+ [ -e $pid_file ] || return 1
+
+ kill -9 $(cat $pid_file)
- kill -9 `cat $pid_file`
+ [ $? -eq 0 ] || return 1
- if [ $? -ne 0 ]; then
- return 1
- fi
-
rm $pid_file
}