Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 2b6d57de11205d1e4ec8b18312057c35 > files > 165

initng-ifiles-0.1.5-4.fc12.i686.rpm

#!/sbin/itype
# This is a i file, used by initng parsed by install_service

# NAME: wpa_supplicant
# DESCRIPTION: IEEE802.1x (WPA) encryption for wireless LAN connections
# WWW: http://hostap.epitest.fi/wpa_supplicant

daemon daemon/wpa_supplicant/* {
	need = system/bootmisc;
	use = system/ifrename system/modules;
	pid_file = /var/run/wpa_supplicant-${NAME}.pid;
	env CONFFILE = /etc/wpa_supplicant.conf;
	forks;
	script daemon =  {
		. ${INITNG_PLUGIN_DIR}/scripts/net/functions

		eval opts=\"\$\{wpa_supplicant_${ifvar}\} -i${iface} -c${CONFFILE} -B\"
		[ -f /sbin/wpa_cli.action ] && \
			opts="${opts} -w -P/var/run/wpa_supplicant-${iface}.pid"

		/sbin/wpa_supplicant ${opts}

		if [ -f /sbin/wpa_cli.action ]
		then
			/sbin/ngc --quiet --instant -u daemon/wpa_cli/${iface}
			exit 0
		fi

		source "${libdir}/wpa_supplicant"
		if ! wpa_supplicant_associate
		then
			/usr/sbin/wpa_cli -i${iface} terminate
			exit 1
		fi

		/sbin/ngc --quiet --instant -u net/${iface}
	};
	script kill = {
		/usr/sbin/pkill -f "/sbin/wpa_supplicant .* -i${NAME} "
	};
}