From 2b1a864bc42cff3a9daae42418608d2b5b69dad0 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 21 Nov 2007 15:39:43 +0000 Subject: [PATCH] BSD shouldn't need to use wpa_cli to manage link events --- net/wpa_supplicant.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/net/wpa_supplicant.sh b/net/wpa_supplicant.sh index 63c37c35..1bdbb9c1 100644 --- a/net/wpa_supplicant.sh +++ b/net/wpa_supplicant.sh @@ -70,6 +70,7 @@ wpa_supplicant_pre_start() { wpas=/sbin/wpa_supplicant wpac=/bin/wpa_cli fi + [ "${RC_UNAME}" = "Linux" ] || unset wpac eval opts=\$wpa_supplicant_${IFVAR} case " ${opts} " in @@ -92,7 +93,6 @@ wpa_supplicant_pre_start() { save_options "SSID" "" ebegin "Starting wpa_supplicant on" "${IFVAR}" - if [ -x /sbin/iwconfig ] ; then local x= for x in txpower rate rts frag ; do @@ -139,11 +139,21 @@ wpa_supplicant_pre_start() { actfile="/etc/wpa_supplicant/wpa_cli.sh" + if [ -n "${wpac}" ]; then + opts="${opts} -W" + else + sleep 2 # FBSD 7.0 beta2 bug + mark_service_inactive "${SVCNAME}" + fi start-stop-daemon --start --exec "${wpas}" \ --pidfile "/var/run/wpa_supplicant-${IFACE}.pid" \ - -- ${opts} -W -B -i "${IFACE}" \ + -- ${opts} -B -i "${IFACE}" \ -P "/var/run/wpa_supplicant-${IFACE}.pid" eend $? || return 1 + if [ -z "${wpac}" ]; then + ebegin "Backgrounding ..." + exit 1 + fi # Starting wpa_supplication-0.4.0, we can get wpa_cli to # start/stop our scripts from wpa_supplicant messages