diff options
author | Jakub Jankowski <shasta@toxcorp.com> | 2018-01-08 03:41:03 +0100 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2018-05-24 01:23:40 -0500 |
commit | cda761f22b855806f338ece31734df1ce4824ad6 (patch) | |
tree | 90002d54cd08c13f40cfb854168e3a73d152ba95 /rc.wireless | |
parent | 2e90f05b5634c51776bb7014aeef1f903d9a4122 (diff) | |
download | slacknetsetup-cda761f22b855806f338ece31734df1ce4824ad6.tar.xz |
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 <shasta@toxcorp.com>
Diffstat (limited to 'rc.wireless')
-rw-r--r-- | rc.wireless | 6 |
1 files 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 |