diff --git a/pastincidents.txt b/pastincidents.txt new file mode 100644 index 0000000..e69de29 diff --git a/tinystatus b/tinystatus index 1b8fb58..43f056e 100755 --- a/tinystatus +++ b/tinystatus @@ -7,10 +7,12 @@ HEADER="Global Status" HTMLDIR="/var/www/htdocs/default" HTMLFILE="index.html" INCIDENTSFILE="incidents.txt" +PASTINCIDENTSFILE="pastincidents.txt" PUSHOVER="/home/mischa/bin/pushover.pl" PUSHOVER_CONF="/home/mischa/_pushover.conf" PUSHOVER_STATUS="status" RECIPIENT="alerts@high5.nl" +REFRESH=60 SENDER="tinystatus@high5.nl" TIMEOUT=10 TITLE="Tiny Status" @@ -18,7 +20,7 @@ USERAGENT="User-Agent: Mozilla/5.0 (OpenBSD; Intel OpenBSD 7.4; rv:109.0) Gecko/ WORKDIR=/home/mischa/tinystatus usage() { - echo "usage: ${0##*/} [-c checksfile] [-i incidentsfile] [-o htmlfile]" 1>&2 + echo "usage: ${0##*/} [-c checksfile] [-i incidentsfile] [-p pastincidentsfile] [-o htmlfile]" 1>&2 exit } @@ -94,6 +96,7 @@ while getopts c:i:o:h arg; do case ${arg} in c) CHECKFILE=${OPTARG};; i) INCIDENTSFILE=${OPTARG};; + p) PASTINCIDENTSFILE=${OPTARG};; o) HTMLFILE=${OPTARG};; h) usage;; *) usage;; @@ -120,7 +123,14 @@ done < "${CHECKFILE}" wait cat << EOF >> ${_htmlfile} -${TITLE} + +

${HEADER}

@@ -189,8 +200,15 @@ done cat << EOF >> ${_htmlfile}

Last check: $(date +%FT%T%z) Tinystatus loosely based on Tinystatus

+EOF +if [ -s "${PASTINCIDENTSFILE}" ]; then + echo '

Past Incidents

' >> ${_htmlfile} + sed 's|^\(.*\)$|

\1

|' "${PASTINCIDENTSFILE}" >> ${_htmlfile} +fi +cat << EOF >> ${_htmlfile}
- + + EOF cp ${_htmlfile} ${HTMLDIR}/${HTMLFILE}