aboutsummaryrefslogtreecommitdiffstats
path: root/run
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2020-12-30 14:20:21 +0000
committerTomasz Kramkowski <tk@the-tk.com>2020-12-30 14:32:50 +0000
commitb927aa1d91d50887e3bb5fa4333687d8ab373828 (patch)
treeb6b9bbb48027a39fadaa7cdef99348bbac607252 /run
downloadbattd-b927aa1d91d50887e3bb5fa4333687d8ab373828.tar.gz
battd-b927aa1d91d50887e3bb5fa4333687d8ab373828.tar.xz
battd-b927aa1d91d50887e3bb5fa4333687d8ab373828.zip
init commit
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