diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-07-03 12:05:24 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-07-03 12:05:24 +0200 |
commit | 7e2ff917a67573ed957d57d2fd077b4c219c0d86 (patch) | |
tree | 47902df1e57bb4d4a24eccc3f364944bee3bcef3 /src/8021x | |
parent | b0373830cd79e35ea0d266726109c36a57122857 (diff) | |
download | netctl-7e2ff917a67573ed957d57d2fd077b4c219c0d86.tar.gz netctl-7e2ff917a67573ed957d57d2fd077b4c219c0d86.tar.xz |
Better grep usage
When possible, fgrep is preferred.
This prevents interpreting variable search patterns as expressions.
In setting the control paths, the search expression was updated to match what wpa_supplicant uses.
Diffstat (limited to 'src/8021x')
-rw-r--r-- | src/8021x | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -105,7 +105,7 @@ wpa_supplicant_scan_and_find() { for ((try=0; try < $RETRIES; try++)); do local found sleep 2 - found=$(wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan_results | tail -n+2 | cut -f ${FIELD} | grep -F -x -m 1 "${ITEM}") + found=$(wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan_results | tail -n+2 | cut -f ${FIELD} | fgrep -x -m 1 "${ITEM}") (( $? == 0 )) && scan_ok=1 # ITEM has been found, echo it @@ -144,7 +144,7 @@ wpa_supplicant_scan_info() { # Wait at least 3 seconds for scan results sleep 3 # Sometimes, that is not enough (FS#29946) - timeout_wait 7 '! wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status | grep -q "wpa_state=SCANNING"' + timeout_wait 7 '! wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" status | fgrep -q "wpa_state=SCANNING"' wpa_cli -p "$WPA_CTRL_PATH" -i "$INTERFACE" scan_results | grep -v "^Selected" | grep -v "^bssid" | |