From: Roman Bazalevsky Date: Tue, 13 Nov 2018 05:00:06 +0000 (+0300) Subject: Незначительные правки. Добавлен скрипт для проверки состояния и перезапуска отваливши... X-Git-Url: https://git.rvb.name/weathermon.git/commitdiff_plain/0a2693126165f68131a1d1686a2bee1f1967494d?ds=inline Незначительные правки. Добавлен скрипт для проверки состояния и перезапуска отвалившихся процессов, если PROCD не справился. --- diff --git a/bin/weather-watchdog b/bin/weather-watchdog new file mode 100644 index 0000000..4847477 --- /dev/null +++ b/bin/weather-watchdog @@ -0,0 +1,10 @@ +#!/bin/sh + +stamp=`date +%s -r $(uci get weathermon.process.dump_file)` +now=`date +%s` +delta=$(( $now - $stamp )) +if [[ $delta -ge 300 ]]; then + /etc/init.d/weathermon restart +fi + +pgrep weather-display > /dev/null || /etc/init.d/weather-display restart diff --git a/init.d/weather-display b/init.d/weather-display index ed9c44f..bf3fbef 100755 --- a/init.d/weather-display +++ b/init.d/weather-display @@ -17,7 +17,7 @@ start_service() { procd_open_instance procd_set_param command "$PROG" procd_set_param nice "$NICEPRIO" - procd_set_param respawn ${respawn_threshold:-600} ${respawn_timeout:-5} ${respawn_retry:-5} + procd_set_param respawn procd_close_instance } diff --git a/init.d/weathermon b/init.d/weathermon index cb1822a..802529e 100755 --- a/init.d/weathermon +++ b/init.d/weathermon @@ -31,7 +31,7 @@ start_service() { procd_open_instance procd_set_param command "$PROG" procd_set_param nice "$NICEPRIO" - procd_set_param respawn ${respawn_threshold:-600} ${respawn_timeout:-5} ${respawn_retry:-5} + procd_set_param respawn procd_close_instance } diff --git a/openwrt-web/properties.json b/openwrt-web/properties.json new file mode 100644 index 0000000..2346031 --- /dev/null +++ b/openwrt-web/properties.json @@ -0,0 +1,22 @@ +{ + "names":{ + "EACFB0F92443.BH1750.LUX":"Освещенность", + "EACFB0F92443.AM2315.TEMPERATURE":"Температура" + }, + "colors":{ + "EACFB0F92443.BH1750.LUX":"darkorange", + "EACFB0F92443.AM2315.TEMPERATURE":"red" + }, + "units":{ + "EACFB0F92443.BH1750.LUX":"Лк.", + "EACFB0F92443.AM2315.TEMPERATURE":"°C" + }, + "scale": { + "EACFB0F92443.BH1750.LUX": [ 1, 0 ], + "EACFB0F92443.AM2315.TEMPERATURE": [ 1, 1 ] + }, + "fonts": { + "axes": { "color": "black", "size": 16, "style": "normal" }, + "legend": { "color": "black", "size": 16, "style": "normal" } + } +}