aboutsummaryrefslogtreecommitdiff
path: root/net/isc-dhcp/files/dhclient.init
blob: 543cdf8cdbf02a274eb95ca758d9323111eca051 (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/dhclient.leases
config_file=/etc/dhclient.conf
pid_file=/var/run/dhclient.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 -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
}