dma: drop CVS ids
[dragonfly.git] / etc / rc.d / wpa_supplicant
blob553bc29ab9ccdc8d53fe234e5819e80320629e83
1 #!/bin/sh
3 # $FreeBSD: src/etc/rc.d/wpa_supplicant,v 1.2 2005/10/19 22:26:47 jkim Exp $
4 # $DragonFly: src/etc/rc.d/wpa_supplicant,v 1.2 2008/07/07 00:00:56 thomas Exp $
7 # PROVIDE: wpa_supplicant
8 # REQUIRE: mountcritremote
9 # KEYWORD: nojail nostart
11 . /etc/rc.subr
12 . /etc/network.subr
14 name="wpa_supplicant"
15 rcvar=
16 command="/usr/sbin/${name}"
17 conf_file="/etc/wpa_supplicant.conf"
19 start_precmd="wpa_supplicant_precmd"
20 wpa_supplicant_precmd()
22 ifconfig $ifn up
24 start_postcmd="wpa_supplicant_postcmd"
25 wpa_supplicant_postcmd()
27 while ! ifconfig $ifn | grep -qw "status: associated"; do
28 sleep 1
29 done
32 ifn="$2"
33 if [ -z "$ifn" ]; then
34 return 1
37 case ${ifn} in
38 ndis*)
39 driver="ndis"
42 driver="bsd"
44 esac
46 load_rc_config $name
48 pid_file="/var/run/${name}/${ifn}.pid"
49 command_args="-B -q -i $ifn -c $conf_file -D $driver -P $pid_file"
50 required_files=$conf_file
52 run_rc_command "$1"