diff options
Diffstat (limited to 'net-scripts/net/iwconfig.sh')
-rw-r--r-- | net-scripts/net/iwconfig.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net-scripts/net/iwconfig.sh b/net-scripts/net/iwconfig.sh index e2ea762..4093078 100644 --- a/net-scripts/net/iwconfig.sh +++ b/net-scripts/net/iwconfig.sh @@ -64,7 +64,7 @@ iwconfig_exists() { && return 0 [[ ! -e /proc/net/wireless ]] && return 1 - [[ $(</proc/net/wireless) =~ $'\n'"[ \t]*$1:" ]] + grep -q "^[ \t]*$1:" /proc/net/wireless } # char* iwconfig_get_wep_status(char *interface) @@ -74,7 +74,7 @@ iwconfig_exists() { iwconfig_get_wep_status() { local mode= status="disabled" - if [[ $(iwconfig "$1") =~ $'\n'" +Encryption key:[0-9,A-F]" ]]; then + if iwconfig "$1" | grep -qE "^ +Encryption key:[0-9,A-F]" ; then status="enabled" mode=$(iwconfig "$1" | sed -n -e 's/^.*Security mode:\(.*[^ ]\).*/\1/p') [[ -n ${mode} ]] && mode=" - ${mode}" |