aboutsummaryrefslogtreecommitdiffstats
path: root/run
blob: 784c89ca4008fc9d55a2b51d4d43588b34b32f3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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