aboutsummaryrefslogtreecommitdiffstats
path: root/run
diff options
context:
space:
mode:
Diffstat (limited to 'run')
-rwxr-xr-xrun23
1 files changed, 23 insertions, 0 deletions
diff --git a/run b/run
new file mode 100755
index 0000000..784c89c
--- /dev/null
+++ b/run
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Copyright (C) 2020 Tomasz Kramkowski <tk@the-tk.com>
+# SDPX-License-Identifier: MIT
+
+. ./conf || exit 1
+trap '. ./conf' HUP
+
+check
+laststatus=$?
+
+while :; do
+ if interval; then
+ sleep "${long_interval-300}"
+ else
+ sleep "${short_interval-30}"
+ fi
+ check
+ status=$?
+ if [ "$laststatus" -eq 0 ] && [ "$status" -ne 0 ]; then
+ failed
+ fi
+ laststatus=$status
+done