1147682Sbrooks#!/bin/sh 2147682Sbrooks# 3147682Sbrooks# $FreeBSD: releng/10.2/etc/rc.d/wpa_supplicant 196436 2009-08-23 05:47:19Z dougb $ 4147682Sbrooks# 5147682Sbrooks 6147682Sbrooks# PROVIDE: wpa_supplicant 7147682Sbrooks# REQUIRE: mountcritremote 8147682Sbrooks# KEYWORD: nojail nostart 9147682Sbrooks 10147682Sbrooks. /etc/rc.subr 11147682Sbrooks. /etc/network.subr 12147682Sbrooks 13147682Sbrooksname="wpa_supplicant" 14147682Sbrooksrcvar= 15147682Sbrooks 16147682Sbrooksifn="$2" 17147682Sbrooksif [ -z "$ifn" ]; then 18147682Sbrooks return 1 19147682Sbrooksfi 20147682Sbrooks 21178356Ssamis_ndis_interface() 22178356Ssam{ 23178356Ssam case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in 24178356Ssam ndis*) true ;; 25178356Ssam *) false ;; 26178356Ssam esac 27178356Ssam} 28178356Ssam 29178356Ssamif is_wired_interface ${ifn} ; then 30178356Ssam driver="wired" 31178356Ssamelif is_ndis_interface ${ifn} ; then 32151489Sjkim driver="ndis" 33178356Ssamelse 34178356Ssam driver="bsd" 35178356Ssamfi 36151489Sjkim 37147682Sbrooksload_rc_config $name 38147682Sbrooks 39178022Ssamcommand=${wpa_supplicant_program} 40178022Ssamconf_file=${wpa_supplicant_conf_file} 41178018Ssampidfile="/var/run/${name}/${ifn}.pid" 42178022Ssamcommand_args="-B -i $ifn -c $conf_file -D $driver -P $pidfile" 43147682Sbrooksrequired_files=$conf_file 44178356Ssamrequired_modules="wlan_wep wlan_tkip wlan_ccmp" 45147682Sbrooks 46147682Sbrooksrun_rc_command "$1" 47