From patchwork Thu Mar 24 22:21:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4/4] Setzt einen Wert wenn der Router weder Position noch Mail Adresse hat, cronjob alle 5 Minuten From: =?utf-8?q?Christoph_s=C3=BCpke?= X-Patchwork-Id: 37 Message-Id: <1458858097-13728-1-git-send-email-suepke.christoph@gmail.com> To: franken-dev@freifunk.net Cc: Christoph Date: Thu, 24 Mar 2016 23:21:37 +0100 Signed-off-by: Christoph --- 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.@system[0].latitude +lat=$? +uci get system.@system[0].longitude +lon=$? +uci get system.@system[0].contact +mail=$? +if [ $lat -eq 1 ] && [ $lon -eq 1 ] && [ $mail -eq 1 ] ; then +echo "Bitte eintragen" +uci set system.@system[0].NoPosAndMail="1" +uci commit + +else +uci set system.@system[0].NoPosAndMail="0" +uci commit + +fi + +def=`uci get system.@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