Незначительные правки. Добавлен скрипт для проверки состояния и перезапуска отваливши...
authorRoman Bazalevsky <rvb@rvb.name>
Tue, 13 Nov 2018 05:00:06 +0000 (08:00 +0300)
committerRoman Bazalevsky <rvb@rvb.name>
Tue, 13 Nov 2018 05:00:06 +0000 (08:00 +0300)
bin/weather-watchdog [new file with mode: 0644]
init.d/weather-display
init.d/weathermon
openwrt-web/properties.json [new file with mode: 0644]

diff --git a/bin/weather-watchdog b/bin/weather-watchdog
new file mode 100644 (file)
index 0000000..4847477
--- /dev/null
@@ -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
index ed9c44f0057fcf86fdf49f2ee8849605bf3b6752..bf3fbef693d2132ddef87ed47a47af5decac2114 100755 (executable)
@@ -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
 }
 
index cb1822acb70932ed615cdf9075d01b0cb2d9638a..802529e5eac7c880abd2941fecd6c34ad71825a4 100755 (executable)
@@ -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 (file)
index 0000000..2346031
--- /dev/null
@@ -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" }
+  }
+}