Sync 'make distribution' with an upgraded system, file-wise.
[dragonfly.git] / etc / rc.d / wpa_supplicant
blob9c94cf4b5dfb0e26bf4af3ad7ae292565515fefb
1 #!/bin/sh
3 # $FreeBSD: src/etc/rc.d/wpa_supplicant,v 1.2 2005/10/19 22:26:47 jkim Exp $
6 # PROVIDE: wpa_supplicant
7 # REQUIRE: mountcritremote
8 # KEYWORD: nojail nostart
10 . /etc/rc.subr
11 . /etc/network.subr
13 name="wpa_supplicant"
14 rcvar=
15 command="/usr/sbin/${name}"
16 conf_file="/etc/wpa_supplicant.conf"
18 start_precmd="wpa_supplicant_precmd"
19 wpa_supplicant_precmd()
21 ifconfig $ifn up
23 start_postcmd="wpa_supplicant_postcmd"
24 wpa_supplicant_postcmd()
26 while ! ifconfig $ifn | grep -qw "status: associated"; do
27 sleep 1
28 done
31 ifn="$2"
32 if [ -z "$ifn" ]; then
33 return 1
36 is_ndis_interface()
38 case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in
39 ndis*) true ;;
40 *) false ;;
41 esac
44 if is_ndis_interface ${ifn}; then
45 driver="ndis"
46 else
47 driver="bsd"
50 load_rc_config $name
52 pid_file="/var/run/${name}/${ifn}.pid"
53 command_args="-B -q -i $ifn -c $conf_file -D $driver -P $pid_file"
54 required_files=$conf_file
56 run_rc_command "$1"