From 0a2693126165f68131a1d1686a2bee1f1967494d Mon Sep 17 00:00:00 2001 From: Roman Bazalevsky Date: Tue, 13 Nov 2018 08:00:06 +0300 Subject: [PATCH 1/1] =?utf8?q?=D0=9D=D0=B5=D0=B7=D0=BD=D0=B0=D1=87=D0=B8?= =?utf8?q?=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=BF=D1=80=D0=B0?= =?utf8?q?=D0=B2=D0=BA=D0=B8.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=20=D0=B4=D0=BB?= =?utf8?q?=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20?= =?utf8?q?=D1=81=D0=BE=D1=81=D1=82=D0=BE=D1=8F=D0=BD=D0=B8=D1=8F=20=D0=B8?= =?utf8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA?= =?utf8?q?=D0=B0=20=D0=BE=D1=82=D0=B2=D0=B0=D0=BB=D0=B8=D0=B2=D1=88=D0=B8?= =?utf8?q?=D1=85=D1=81=D1=8F=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81?= =?utf8?q?=D0=BE=D0=B2,=20=D0=B5=D1=81=D0=BB=D0=B8=20PROCD=20=D0=BD=D0=B5?= =?utf8?q?=20=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D1=81=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/weather-watchdog | 10 ++++++++++ init.d/weather-display | 2 +- init.d/weathermon | 2 +- openwrt-web/properties.json | 22 ++++++++++++++++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 bin/weather-watchdog create mode 100644 openwrt-web/properties.json 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" } + } +} -- 2.34.1