summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-12-23 10:13:58 +0000
committerRoy Marples <roy@marples.name>2008-12-23 10:13:58 +0000
commit9d9f17aa523f2e5df6067c6a1d6ee9808fb2479f (patch)
treed3b1026d60abbd2e420e867ae23bf3c08a42ddf0
parent803dbbf0c808cf8d24b44bf3e944175366ff92a6 (diff)
downloadopenrc-9d9f17aa523f2e5df6067c6a1d6ee9808fb2479f.tar.gz
openrc-9d9f17aa523f2e5df6067c6a1d6ee9808fb2479f.tar.bz2
openrc-9d9f17aa523f2e5df6067c6a1d6ee9808fb2479f.tar.xz
Allow working with the new ctrl_iface=DIR=foo directive.
-rw-r--r--net/wpa_supplicant.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/wpa_supplicant.sh b/net/wpa_supplicant.sh
index 543f251..54e13e8 100644
--- a/net/wpa_supplicant.sh
+++ b/net/wpa_supplicant.sh
@@ -105,7 +105,13 @@ wpa_supplicant_pre_start()
fi
# Work out where the ctrl_interface dir is if it's not specified
- local ctrl_dir=$(sed -n -e 's/[[:space:]]*#.*//g;s/[[:space:]]*$//g;s/^ctrl_interface=//p' "${cfgfile}")
+ local ctrl_dir=$(sed -e '/^ctrl_interface=/!d' \
+ -e 's/^ctrl_interface=//' \
+ -e 's/^ *//' \
+ -e 's/^DIR=//' \
+ -e 's/^ *//' \
+ -e 's/GROUP=.*//' \
+ "${cfgfile}")
if [ -z "${ctrl_dir}" ]; then
ctrl_dir=${opts##* -C}
if [ -n "${ctrl_dir}" -a "${ctrl_dir}" != "${opts}" ]; then