summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rc.wireless6
1 files changed, 2 insertions, 4 deletions
diff --git a/rc.wireless b/rc.wireless
index 3b09e2e..a4b20a1 100644
--- a/rc.wireless
+++ b/rc.wireless
@@ -110,8 +110,7 @@ is_wireless_device ${INTERFACE} || return 0 2> /dev/null || exit 0
# If we stop a wireless interface using wpa_supplicant,
# we'll kill its wpa_supplicant daemon too and exit this script:
if [ "$2" = "stop" ]; then
- WPAPID=$(echo $(ps axww | grep wpa_supplicant | grep i${INTERFACE}) | cut -f1 -d' ')
- [ ${WPAPID} ] && kill ${WPAPID}
+ pkill --full "bin/wpa_supplicant.* -i${INTERFACE}"
return 0
fi
@@ -294,8 +293,7 @@ if [ "$WPA" = "wpa_supplicant" ] || [ "$WPA" = "wpaxsupplicant" ] && [ -x ${SUPP
[ ${WPA} = "wpaxsupplicant" ] && WPA_OPTIONS="${WPA_OPTIONS} -e" # Use external xsupplicant (disables the internal supplicant)
# We leave a running wpa_supplicant process in peace:
- WPAPID=$(echo $(ps axww | grep wpa_supplicant | grep i${INTERFACE}) | cut -f1 -d' ')
- if [ ${WPAPID} ]; then
+ if pgrep --full "bin/wpa_supplicant.* -i${INTERFACE}" >/dev/null ; then
echo "$0: wpa_supplicant found running already" | $LOGGER
else
echo "$0: wpa_supplicant -B -c${WPACONF} ${WPA_OPTIONS} -i$INTERFACE" | $LOGGER