# a LTE Router with either OpenWRT or Teltonika RutOS.
# Requires curl other stock sh/cut/cat/test are enough.
+### path to the suntime / check for daylight script
+checkdaylight="./suntime.lua"
+
+### opsgenie configuration
+API_HOST="api.eu.opsgenie.com"
+API_KEY=""
+
+# adjust meteocontrol default password and IPs
+# meteocontrol devices must be added to the main loop as well
+mc1="http://admin:ist02@192.168.1.2/html/de/onlineOverWr.html"
+mc2="http://admin:ist02@192.168.1.3/html/de/onlineOverWr.html"
+
+
+### check for daylight, otherwise exit early
+${checkdaylight} || exit 3
+
+
# createAlert <alias> <message> <description>
createAlert() {
local alias="${1}"
return 0
}
-### main configuration
-API_HOST="api.eu.opsgenie.com"
-API_KEY=""
-
-# adjust meteocontrol default password and IPs
-mc1="http://admin:ist02@192.168.1.2/html/de/onlineOverWr.html"
-mc2="http://admin:ist02@192.168.1.3/html/de/onlineOverWr.html"
-
### main loop
for dev in mc1 mc2; do
outfile="/tmp/${dev}.html"