From cda761f22b855806f338ece31734df1ce4824ad6 Mon Sep 17 00:00:00 2001 From: Jakub Jankowski Date: Mon, 8 Jan 2018 03:41:03 +0100 Subject: Replace -a / -o in conditionals with && / || Conditional expression like [ test1 -a test2 ] should be avoided as it is not well defined. See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16 and https://github.com/koalaman/shellcheck/wiki/SC2166 Signed-off-by: Jakub Jankowski --- rc.wireless | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc.wireless b/rc.wireless index 0aac434..3b09e2e 100644 --- a/rc.wireless +++ b/rc.wireless @@ -177,7 +177,7 @@ WPACONF=${WLAN_WPACONF[$i]:-${WPACONF:="/etc/wpa_supplicant.conf"}} WPAWAIT=${WLAN_WPAWAIT[$i]:-${WPAWAIT:="60"}} -[ -n "$VERBOSE" -a -n "$INFO" ] && echo "$0: $1 information: '$INFO'" +[ -n "$VERBOSE" ] && [ -n "$INFO" ] && echo "$0: $1 information: '$INFO'" ################### # WIRELESS CONFIG # @@ -199,7 +199,7 @@ fi if [ ! -n "$NICKNAME" ] ; then NICKNAME=$(/bin/hostname) fi -if [ -n "$ESSID" -o -n "$MODE" ] ; then +if [ -n "$ESSID" ] || [ -n "$MODE" ] ; then echo "$0: $IWCOMMAND nick $NICKNAME" | $LOGGER $IWCOMMAND nick $NICKNAME fi @@ -217,7 +217,7 @@ elif [ -n "$CHANNEL" ] ; then fi # WEP keys (non-WPA) -if [ -n "$KEY" -a ! -n "$WPA" ] ; then +if [ -n "$KEY" ] && [ ! -n "$WPA" ] ; then if [ "$KEY" = "off" ]; then echo "$0: $IWCOMMAND key open" | $LOGGER $IWCOMMAND key open -- cgit v1.2.3