1#!/bin/sh 2# 3# $FreeBSD: releng/10.2/etc/rc.d/wpa_supplicant 196436 2009-08-23 05:47:19Z dougb $ 4# 5 6# PROVIDE: wpa_supplicant 7# REQUIRE: mountcritremote 8# KEYWORD: nojail nostart 9 10. /etc/rc.subr 11. /etc/network.subr 12 13name="wpa_supplicant" 14rcvar= 15 16ifn="$2" 17if [ -z "$ifn" ]; then 18 return 1 19fi 20 21is_ndis_interface() 22{ 23 case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in 24 ndis*) true ;; 25 *) false ;; 26 esac 27} 28 29if is_wired_interface ${ifn} ; then 30 driver="wired" 31elif is_ndis_interface ${ifn} ; then 32 driver="ndis" 33else 34 driver="bsd" 35fi 36 37load_rc_config $name 38 39command=${wpa_supplicant_program} 40conf_file=${wpa_supplicant_conf_file} 41pidfile="/var/run/${name}/${ifn}.pid" 42command_args="-B -i $ifn -c $conf_file -D $driver -P $pidfile" 43required_files=$conf_file 44required_modules="wlan_wep wlan_tkip wlan_ccmp" 45 46run_rc_command "$1" 47