packages/net/dhcp4/files/dhclient.init
florian d1a7b7bc4c [package] add ISC DHCP4 4.2.3-P1
Patch from Oliver Smith

git-svn-id: svn://svn.openwrt.org/openwrt/packages@31185 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-04-04 14:13:44 +00:00

34 lines
668 B
Bash

#!/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() {
echo Starting isc-dhclient
/usr/sbin/dhclient -q -nw -cf $config_file -lf $lease_file -pf $pid_file -sf $script_file `/sbin/uci get network.wan.ifname`
if [ $? -ne 0 ]; then
echo " isc-dhclient failed to start"
fi
}
stop() {
echo Stopping isc-dhclient
if [ -e $pid_file ]; then
kill -9 `cat $pid_file`
if [ $? -ne 0 ]; then
echo " PID " `cat $pid_file` not found
echo " Is the DHCP client running?"
fi
rm $pid_file
else
echo " $pid_file not found"
fi
}