1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-18 13:23:57 +02:00
openwrt-packages/net/isc-dhcp/files/dhclient6.init
Philip Prindeville 8a52c2b742 isc-dhcp: use network_get_device in client scripts
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2023-07-25 15:55:14 -06:00

31 lines
515 B
Bash

#!/bin/sh /etc/rc.common
START=60
lease_file=/var/dhclient6.leases
config_file=/etc/dhclient6.conf
pid_file=/var/run/dhclient6.pid
script_file=/usr/sbin/dhclient-script
start() {
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() {
[ -e $pid_file ] || return 1
kill -9 $(cat $pid_file)
[ $? -eq 0 ] || return 1
rm $pid_file
}