Message ID | 20200107115848.1238-2-freifunk@adrianschmutzler.de |
---|---|
State | Superseded |
Headers | show |
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")
Passt, wobei ich den Installationsstatus eher mit dem executable geprüft hätte, aber so ist das denke ich auch ok. Richtig sauber ist eh keine der beiden Möglichkeiten. Reviewed-by: Fabian Bläse <fabian@blaese.de> On 07.01.20 12:58, Adrian Schmutzler wrote: > Suppress error in show_info when simple-tc is not built into the > firmware. > > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > > --- > > Changes in v2: > Resend with added commit message. > --- > 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") >
Suppress error in show_info when simple-tc is not built into the firmware. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> --- Changes in v2: Resend with added commit message. --- src/packages/fff/fff-support/Makefile | 2 +- .../fff/fff-support/files/usr/sbin/show_info | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-)