[PATCH 4/4] Setzt einen Wert wenn der Router weder Position noch Mail Adresse hat, cronjob alle 5 Minuten
Christoph
suepke.christoph at gmail.com
Do Mär 24 23:21:37 CET 2016
Signed-off-by: Christoph <suepke.christoph at gmail.com>
---
bsp/default/root_file_system/etc/config/system.tpl | 2 +-
bsp/default/root_file_system/etc/default.sh | 21 +++++++++++++++++++++
.../root_file_system/usr/lib/micron.d/default | 1 +
3 files changed, 23 insertions(+), 1 deletion(-)
create mode 100755 bsp/default/root_file_system/etc/default.sh
diff --git a/bsp/default/root_file_system/etc/config/system.tpl b/bsp/default/root_file_system/etc/config/system.tpl
index 24cf700..9794e11 100644
--- a/bsp/default/root_file_system/etc/config/system.tpl
+++ b/bsp/default/root_file_system/etc/config/system.tpl
@@ -1,7 +1,7 @@
config 'system'
option 'hostname' 'OpenWrt'
option 'timezone' 'CET-1CEST,M3.5.0,M10.5.0/3'
- option 'default' '1'
+ option 'NoPosAndMail' '1'
config 'led' 'status_led_green'
option 'name' 'status'
diff --git a/bsp/default/root_file_system/etc/default.sh b/bsp/default/root_file_system/etc/default.sh
new file mode 100755
index 0000000..64ab896
--- /dev/null
+++ b/bsp/default/root_file_system/etc/default.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+uci get system. at system[0].latitude
+lat=$?
+uci get system. at system[0].longitude
+lon=$?
+uci get system. at system[0].contact
+mail=$?
+if [ $lat -eq 1 ] && [ $lon -eq 1 ] && [ $mail -eq 1 ] ; then
+echo "Bitte eintragen"
+uci set system. at system[0].NoPosAndMail="1"
+uci commit
+
+else
+uci set system. at system[0].NoPosAndMail="0"
+uci commit
+
+fi
+
+def=`uci get system. at system[0].NoPosAndMail`
+echo $def
diff --git a/bsp/default/root_file_system/usr/lib/micron.d/default b/bsp/default/root_file_system/usr/lib/micron.d/default
index 3dbf3d7..defbfcf 100644
--- a/bsp/default/root_file_system/usr/lib/micron.d/default
+++ b/bsp/default/root_file_system/usr/lib/micron.d/default
@@ -1,2 +1,3 @@
*/5 * * * * sleep $(/usr/bin/random 0 29); sh /etc/fastdstart.sh
*/1 * * * * /usr/sbin/batctl gw off; sleep 1; /usr/sbin/batctl gw client
+*/5 * * * * sh /etc/default.sh
--
1.9.1
Mehr Informationen über die Mailingliste franken-dev