[RFC PATCH 3/3] fff-web: Added options to disable update notification

Adrian Schmutzler freifunk at adrianschmutzler.de
Fr Jul 14 14:56:04 CEST 2017


Update notification is enabled by default. If required, this
allows disabling it either until next firmware upgrade or
permanently.

Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 bsp/default/root_file_system/etc/rc.local                  |  6 ++++++
 src/packages/fff/fff-web/Makefile                          |  2 +-
 .../etc/uci-defaults/06-fff-reset-update-notification      |  9 +++++++++
 .../fff-web/files/usr/sbin/disable_update_notification.sh  | 14 ++++++++++++++
 4 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 src/packages/fff/fff-web/files/etc/uci-defaults/06-fff-reset-update-notification
 create mode 100755 src/packages/fff/fff-web/files/usr/sbin/disable_update_notification.sh

diff --git a/bsp/default/root_file_system/etc/rc.local b/bsp/default/root_file_system/etc/rc.local
index 212a5f3..6049452 100755
--- a/bsp/default/root_file_system/etc/rc.local
+++ b/bsp/default/root_file_system/etc/rc.local
@@ -6,6 +6,12 @@
 if [ -s /usr/sbin/configurefffinit ] ; then
 	/usr/sbin/configurefffinit && mv /usr/sbin/configurefffinit /usr/sbin/configurefff
 fi
+if [ "$(uci -q get fff.notifyupdate.value)" = "0" ] ; then
+	/bin/rm -f /tmp/isupdate
+
+	NEXTUPDATE=$(($(date +%s)+864000000)) # 1000 days
+	echo $NEXTUPDATE > /tmp/fwcheck
+fi
 
 touch /tmp/started
 
diff --git a/src/packages/fff/fff-web/Makefile b/src/packages/fff/fff-web/Makefile
index 906bf49..9c6b68b 100644
--- a/src/packages/fff/fff-web/Makefile
+++ b/src/packages/fff/fff-web/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff-web
-PKG_VERSION:=5
+PKG_VERSION:=6
 PKG_RELEASE:=2
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/fff-web
diff --git a/src/packages/fff/fff-web/files/etc/uci-defaults/06-fff-reset-update-notification b/src/packages/fff/fff-web/files/etc/uci-defaults/06-fff-reset-update-notification
new file mode 100644
index 0000000..4d270b4
--- /dev/null
+++ b/src/packages/fff/fff-web/files/etc/uci-defaults/06-fff-reset-update-notification
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$(uci -q get fff.notifyupdate.resetonupgrade)" = "1" ] ; then
+	uci -q set "fff.notifyupdate.value=1"
+	uci -q commit fff
+	/bin/rm -f /tmp/fwcheck
+fi
+
+exit 0
diff --git a/src/packages/fff/fff-web/files/usr/sbin/disable_update_notification.sh b/src/packages/fff/fff-web/files/usr/sbin/disable_update_notification.sh
new file mode 100755
index 0000000..5ebf602
--- /dev/null
+++ b/src/packages/fff/fff-web/files/usr/sbin/disable_update_notification.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# This disables the WebUI update notification permanently
+# (until next firmware upgrade)
+
+uci -q set "fff.notifyupdate=webui"
+uci -q set "fff.notifyupdate.value=0"
+uci -q set "fff.notifyupdate.resetonupgrade=1"
+
+uci -q commit fff
+
+/bin/rm -f /tmp/isupdate
+
+NEXTUPDATE=$(($(date +%s)+864000000)) # 1000 days
+echo $NEXTUPDATE > /tmp/fwcheck
-- 
2.7.4



Mehr Informationen über die Mailingliste franken-dev