aboutsummaryrefslogtreecommitdiff
path: root/net/isc-dhcp/files/dhclient6.init
blob: 630c3f25f1ae1913b3ff6dece514aef805d9e61e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/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() {
	/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
}

stop() {
	if [ ! -e $pid_file ]; then
		return 1
	fi

	kill -9 `cat $pid_file`

	if [ $? -ne 0 ]; then
		return 1
	fi
	
	rm $pid_file
}