diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-07-08 12:04:21 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-07-08 12:04:21 +0200 |
commit | 4fc69bcd399292e688d19dc3569c7e496419ecd6 (patch) | |
tree | 7d190388df97cbf6d44befecb09827fbe97b343f /src | |
parent | 5511dc38c484d93fda0aaf57e30e6b82f8174918 (diff) | |
download | netctl-4fc69bcd399292e688d19dc3569c7e496419ecd6.tar.gz netctl-4fc69bcd399292e688d19dc3569c7e496419ecd6.tar.xz |
Fix match expression in ctrl_interface parsing (8021x)
In bash built-in substring matching, '*' does not signify repetition of the previous character.
Diffstat (limited to 'src')
-rw-r--r-- | src/8021x | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -9,9 +9,12 @@ wpa_call() if [[ -n "$WPA_CTRL_DIR" ]]; then args+=("-p" "$WPA_CTRL_DIR") elif [[ -n "$WPA_CONF" ]] && grep -q "^[[:space:]]*ctrl_interface=" "$WPA_CONF"; then - WPA_CTRL_DIR=$(grep -m 1 "^[[:space:]]*ctrl_interface=" "$WPA_CONF" | cut -d= -f 2-) - WPA_CTRL_DIR=${WPA_CTRL_DIR#DIR=} - WPA_CTRL_DIR=${WPA_CTRL_DIR%% GROUP=.*} + WPA_CTRL_DIR=$(grep -m 1 "^[[:space:]]*ctrl_interface=" "$WPA_CONF") + WPA_CTRL_DIR=${WPA_CTRL_DIR#*ctrl_interface=} + if [[ "$WPA_CTRL_DIR" == DIR=* ]]; then + WPA_CTRL_DIR=${WPA_CTRL_DIR:4} + WPA_CTRL_DIR=${WPA_CTRL_DIR%% GROUP=*} + fi args+=("-p" "$WPA_CTRL_DIR") fi report_debug wpa_cli "${args[@]}" "$@" |