aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-10 21:34:46 +0000
committerRoy Marples <roy@marples.name>2008-03-10 21:34:46 +0000
commit8b23aaecff11723184bc4761bef68ed98a3ad7af (patch)
tree35a4541974582672febe65ab8cf555367d9fb53f /net
parentf20099bc337eee3238911b48981d82c0e63603ef (diff)
Add ifwatchd.sh to power the NetBSD ifwatchd program. Let wpa_supplicant work with it.
Diffstat (limited to 'net')
-rw-r--r--net/wpa_supplicant.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/net/wpa_supplicant.sh b/net/wpa_supplicant.sh
index 6c04a3a3..204557ad 100644
--- a/net/wpa_supplicant.sh
+++ b/net/wpa_supplicant.sh
@@ -47,12 +47,14 @@ wpa_supplicant_pre_start()
{
local opts= cfgfile= ctrl_dir= wireless=true
local wpas=/usr/sbin/wpa_supplicant wpac=/usr/bin/wpa_cli
+ local actfile=/etc/wpa_supplicant/wpa_cli.sh
if [ ! -x "${wpas}" ]; then
wpas=/sbin/wpa_supplicant
wpac=/bin/wpa_cli
fi
[ "${RC_UNAME}" = "Linux" ] || unset wpac
+ [ -e "${actfile}" ] || unset wpac
eval opts=\$wpa_supplicant_${IFVAR}
case " ${opts} " in
@@ -120,12 +122,10 @@ wpa_supplicant_pre_start()
fi
service_set_value ctrl_dir "${ctrl_dir}"
- actfile="/etc/wpa_supplicant/wpa_cli.sh"
if [ -n "${wpac}" ]; then
opts="${opts} -W"
- else
- sleep 2 # FBSD 7.0 beta2 bug
+ elif service_started devd; then
mark_service_inactive
fi
start-stop-daemon --start --exec "${wpas}" \
@@ -133,9 +133,14 @@ wpa_supplicant_pre_start()
-- ${opts} -B -i "${IFACE}" \
-P "/var/run/wpa_supplicant-${IFACE}.pid"
eend $? || return 1
+
+ # If we don't have a working wpa_cli and action file continue
if [ -z "${wpac}" ]; then
- ebegin "Backgrounding ..."
- exit 1
+ if service_started devd; then
+ ebegin "Backgrounding ..."
+ exit 1
+ fi
+ return 0
fi
# Starting wpa_supplication-0.4.0, we can get wpa_cli to
@@ -147,8 +152,7 @@ wpa_supplicant_pre_start()
ebegin "Starting wpa_cli on" "${IFACE}"
start-stop-daemon --start --exec "${wpac}" \
--pidfile "/var/run/wpa_cli-${IFACE}.pid" \
- -- -a /etc/wpa_supplicant/wpa_cli.sh \
- -p "${ctrl_dir}" -i "${IFACE}" \
+ -- -a "${actfile}" -p "${ctrl_dir}" -i "${IFACE}" \
-P "/var/run/wpa_cli-${IFACE}.pid" -B
if eend $?; then
ebegin "Backgrounding ..."