fff-nodewatcher: Tidy up uci-defaults script

This solves the following issues with the uci-defaults script in
fff-nodewatcher:

- Remove /bin/sh in non-executable file
- Only commit to changed config
- Use "-1" for uci node indexing, as this will be the node just
  created

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
Adrian Schmutzler 2020-01-07 14:40:21 +01:00 committed by Fabian Bläse
parent b6c7acd704
commit 1c3243dd18
3 changed files with 7 additions and 9 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-nodewatcher
PKG_RELEASE:=56
PKG_RELEASE:=57
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

View File

@ -1,14 +1,12 @@
#!/bin/sh
touch /etc/config/nodewatcher
uci batch <<EOF
add nodewatcher script
set nodewatcher.@script[0].error_level='0'
set nodewatcher.@script[0].logfile='/var/log/nodewatcher.log'
set nodewatcher.@script[0].data_file='/tmp/crawldata/node.data'
set nodewatcher.@script[0].status_text_file='/tmp/status.txt'
set nodewatcher.@script[-1].error_level='0'
set nodewatcher.@script[-1].logfile='/var/log/nodewatcher.log'
set nodewatcher.@script[-1].data_file='/tmp/crawldata/node.data'
set nodewatcher.@script[-1].status_text_file='/tmp/status.txt'
EOF
uci commit
uci commit nodewatcher
exit 0

View File

@ -3,7 +3,7 @@
# License; GPL v3
SCRIPT_STATUS_FILE=$(uci get nodewatcher.@script[0].status_text_file)
SCRIPT_VERSION="56"
SCRIPT_VERSION="57"
debug() {
(>&2 echo "$1")