diff --git a/tinystatus b/tinystatus index 4a30731..4907ffc 100755 --- a/tinystatus +++ b/tinystatus @@ -2,8 +2,10 @@ title=tinystatus timeout=10 -tmp="${tmpdir:-/tmp/tinystatus}" +tmp='/tmp/tinystatus' useragent="User-Agent: Mozilla/5.0 (X11; Linux x86_64; Debian) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" +checkfile="${1:-checks.list}" +incidentsfile="${2:-incidents.list}" command_exists(){ if ! command -v "${1}" >/dev/null 2>&1; then @@ -104,9 +106,15 @@ done cat << EOF
Last check: $(date +"%Y/%m/%d %H:%M:%S")
-\1
|' "${2:-incidents.list}" 2>/dev/null || echo "No incident reported yet ;)
" +if [ -f "${incidentsfile}" ]; then + echo '\1
|' "${incidentsfile}" + else + echo 'No incident reported yet ;)
' + fi +fi cat <