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

Submitted by Adrian Schmutzler on July 26, 2019, 2:12 p.m.

Details

Message ID 20190726141208.4620-2-freifunk@adrianschmutzler.de
State New
Headers show

Commit Message

Adrian Schmutzler July 26, 2019, 2:12 p.m.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 src/packages/fff/fff-support/Makefile              |  2 +-
 .../fff/fff-support/files/usr/sbin/show_info       | 14 +++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

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")