1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2007-2014 OpenWrt.org
9 PROG=/usr/bin/weathermon
12 BACKUP_DIR=`uci get weathermon.process.backup_dir`
13 BACKLOGDB=`uci get weathermon.process.backlogdb`
14 LOGDB=`uci get weathermon.process.logdb`
15 WORK_DIR=`uci get weathermon.process.working_dir`
21 if [ ! -z "$BACKLOGDB" ] && [ ! -f "$BACKLOGDB" ]; then
22 BACKLOG_BASE=$(basename "$BACKLOGDB")
23 cp "$BACKUP_DIR/$BACKLOG_BASE" "$BACKLOGDB"
26 if [ ! -z "$LOGDB" ] && [ ! -f "$LOGDB" ]; then
27 LOG_BASE=$(basename "$LOGDB")
28 cp "$BACKUP_DIR/$LOG_BASE" "$LOGDB"
32 procd_set_param command "$PROG"
33 procd_set_param nice "$NICEPRIO"
34 procd_set_param respawn
40 killall weathermon-iio
41 if [ ! -z "$BACKLOGDB" ] && [ -f "$BACKLOGDB" ]; then
42 cp "$BACKLOGDB" "$BACKUP_DIR"/
44 if [ ! -z "$LOGDB" ] && [ -f "$BACKLOGDB" ]; then
45 cp "$LOGDB" "$BACKUP_DIR"/