summaryrefslogtreecommitdiffstats
path: root/src/lib/wpa
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/wpa')
-rw-r--r--src/lib/wpa3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/wpa b/src/lib/wpa
index 65ef8f9..b80c54d 100644
--- a/src/lib/wpa
+++ b/src/lib/wpa
@@ -12,8 +12,7 @@ wpa_call() {
if [[ $WPA_CTRL_DIR ]]; then
args+=("-p" "$WPA_CTRL_DIR")
elif [[ $WPAConfigFile ]] && grep -q "^[[:space:]]*ctrl_interface=" "$WPAConfigFile"; then
- WPA_CTRL_DIR=$(grep -m1 "^[[:space:]]*ctrl_interface=" "$WPAConfigFile")
- WPA_CTRL_DIR=${WPA_CTRL_DIR#*ctrl_interface=}
+ WPA_CTRL_DIR=$(sed -n "0,/^[[:space:]]*ctrl_interface=/s///p" "$WPAConfigFile")
if [[ $WPA_CTRL_DIR == DIR=* ]]; then
WPA_CTRL_DIR=${WPA_CTRL_DIR:4}
WPA_CTRL_DIR=${WPA_CTRL_DIR%% GROUP=*}