o Update dd(1) to accept capital letters (B, K, M, G) as size modifiers.
[dragonfly.git] / etc / rc.d / dhclient
blob967914e06ccd94d56433b9a3462d2866f8ab114b
1 #!/bin/sh
3 # $NetBSD: dhclient,v 1.8 2002/03/22 04:33:58 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/dhclient,v 1.20.2.4 2007/03/10 14:07:01 yar Exp $
5 # $DragonFly: src/etc/rc.d/dhclient,v 1.10 2007/07/10 22:36:01 swildner Exp $
8 # PROVIDE: dhclient
9 # KEYWORD: nojail nostart
12 . /etc/rc.subr
13 . /etc/network.subr
15 name="dhclient"
16 rcvar=
17 start_cmd="dhclient_start"
18 stop_cmd="dhclient_stop"
20 dhclient_start()
22 # prevent unnecessary restarts
23 # XXX: dhclient had better create a pidfile
24 if [ -x /bin/pgrep ]; then
25 pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
26 if [ -n "$pids" ]; then
27 exit 0
31 # Override for $ifn specific flags (see rc.subr for $flags setting)
32 eval specific=\$dhclient_flags_$ifn
33 if [ -z "$flags" -a -n "$specific" ]; then
34 rc_flags=$specific
37 # eval specific=\$background_dhclient_$ifn
38 # if [ -n "$specific" ]; then
39 # if checkyesno background_dhclient_$ifn; then
40 # rc_flags="${rc_flags} -b"
41 # fi
42 # elif checkyesno background_dhclient; then
43 # rc_flags="${rc_flags} -b"
44 # fi
46 ${dhclient_program} ${rc_flags} $ifn
49 dhclient_stop()
51 ifconfig $ifn down # cause dhclient to die
54 ifn="$2"
56 load_rc_config $name
57 load_rc_config network
59 if ! dhcpif $ifn; then
60 return 1
63 run_rc_command "$1"