[2/2] fff-hoods: fix/simplify condition in configurehood

Submitted by Adrian Schmutzler on July 31, 2020, 11:28 p.m.

Details

Message ID 20200731232834.19763-2-freifunk@adrianschmutzler.de
State Accepted
Headers show

Commit Message

Adrian Schmutzler July 31, 2020, 11:28 p.m.
What was intended as grouping of logic operators actually invoked
a subshell. Remove the subshell by using a better choice of operators.

Found by shellcheck.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 src/packages/fff/fff-hoods/Makefile                     | 2 +-
 src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-hoods/Makefile b/src/packages/fff/fff-hoods/Makefile
index e166666a..c9ade0d0 100644
--- a/src/packages/fff/fff-hoods/Makefile
+++ b/src/packages/fff/fff-hoods/Makefile
@@ -1,7 +1,7 @@ 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff-hoods
-PKG_RELEASE:=14
+PKG_RELEASE:=15
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
index 99f0fce4..d07b0125 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -106,7 +106,7 @@  if [ -s "$hoodfiletmp" ]; then
 		
 		json_select ".." # back to root
 		
-		if ! ([ -n "$chan2ghz" ] && [ -n "$chan5ghz" ]) ; then
+		if [ -z "$chan2ghz" ] || [ -z "$chan5ghz" ] ; then
 			# If channel is missing, do nothing
 			exit 0
 		fi

Comments

Fabian Blaese Aug. 1, 2020, 9:10 a.m.
Reviewed-by: Fabian Bläse <fabian@blaese.de>