[PATCH v3 2/2] show_info: Treat case of missing simple-tc package

Adrian Schmutzler freifunk at adrianschmutzler.de
Mo Mär 16 19:13:13 CET 2020


Suppress error in show_info when simple-tc is not built into the
firmware.

Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian at blaese.de>

---

Changes in v2:
Resend with added commit message.

Changes in v3:
none
---
 src/packages/fff/fff-support/Makefile              |  2 +-
 .../fff/fff-support/files/usr/sbin/show_info       | 14 +++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/packages/fff/fff-support/Makefile b/src/packages/fff/fff-support/Makefile
index 7b23a959..76ca26c8 100644
--- a/src/packages/fff/fff-support/Makefile
+++ b/src/packages/fff/fff-support/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff-support
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/src/packages/fff/fff-support/files/usr/sbin/show_info b/src/packages/fff/fff-support/files/usr/sbin/show_info
index d3367aec..cd3b4d2e 100755
--- a/src/packages/fff/fff-support/files/usr/sbin/show_info
+++ b/src/packages/fff/fff-support/files/usr/sbin/show_info
@@ -159,13 +159,17 @@ echo "E-Mail Adresse: $(uci -q get 'fff.system.contact')"
 
 echo ""
 echo "-> BITRATEN-BEGRENZUNG"
-if [ "$(uci -q get 'simple-tc.example.enabled')" = "1" ] ; then
-	echo "Aktiv: ja"
+if [ -s "/etc/config/simple-tc" ]; then
+	if [ "$(uci -q get 'simple-tc.example.enabled')" = "1" ] ; then
+		echo "Aktiv: ja"
+	else
+		echo "Aktiv: nein"
+	fi
+	echo "Download-Limit: $(uci -q get 'simple-tc.example.limit_ingress') kBit/s"
+	echo "Upload-Limit: $(uci -q get 'simple-tc.example.limit_egress') kBit/s"
 else
-	echo "Aktiv: nein"
+	echo "simple-tc nicht installiert."
 fi
-echo "Download-Limit: $(uci -q get 'simple-tc.example.limit_ingress') kBit/s"
-echo "Upload-Limit: $(uci -q get 'simple-tc.example.limit_egress') kBit/s"
 
 if grep -q 'PORTORDER=' /etc/network.$board_name ; then
 	portorder=$(awk -F= '/PORTORDER=/ { print $2 }' /etc/network.$board_name | sed "s/\"//g")
-- 
2.20.1



Mehr Informationen über die Mailingliste franken-dev