summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2013-07-21 00:51:34 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2013-07-21 00:51:34 +0200
commitcbd00d5652700792a7833617d947f8a78bb34ccc (patch)
treef561f0d5b4ebd0ea45b02d54214d24054791d70b /src/lib
parent30ea4c009e9ba095eb6ac94655715cc9531d4594 (diff)
downloadnetctl-cbd00d5652700792a7833617d947f8a78bb34ccc.tar.gz
netctl-cbd00d5652700792a7833617d947f8a78bb34ccc.tar.xz
Introduce sed
Instead of filtering results from grep, we can also just use sed. Installations having grep can be expected to have sed as well.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/connections/wireless2
-rw-r--r--src/lib/wpa3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/connections/wireless b/src/lib/connections/wireless
index fe01b90..870af51 100644
--- a/src/lib/connections/wireless
+++ b/src/lib/connections/wireless
@@ -17,7 +17,7 @@ wireless_up() {
: ${Security:=none}
: ${WPADriver:=nl80211,wext}
: ${TimeoutWPA:=15}
-
+
if [[ $RFKill ]]; then
enable_rf "$Interface" "$RFKill" || return 1
fi
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=*}