From a6562213997b4cfa3840379b234aa9f8c6b9b437 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Fri, 20 May 2011 18:41:42 +0200 Subject: Added API status report, as nowhere.ws will no longer serve it --- scripts/pingscript | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'scripts/pingscript') diff --git a/scripts/pingscript b/scripts/pingscript index 80b1a74..1424eef 100755 --- a/scripts/pingscript +++ b/scripts/pingscript @@ -15,11 +15,19 @@ insertstatus() { fi cp ${WEBPATH}/csstemplate/${status}.${1}.status.css ${WEBPATH}/public/css/${1}.status.css.new mv -f ${WEBPATH}/public/css/${1}.status.css.new ${WEBPATH}/public/css/${1}.status.css + + return $ec +} + +apistatus() { + [ -d "${WEBPATH}/public/api" ] || mkdir -p "${WEBPATH}/public/api" + echo $1 > "${WEBPATH}/public/api/status" } # Ping Taifun ping -q -c 2 -W 1 172.22.83.5 &> /dev/null insertstatus taifun +global_state=$? # Ping Trieste ping -q -c 2 -W 1 172.22.80.4 &> /dev/null @@ -28,5 +36,17 @@ insertstatus trieste # Ping Nautilus ping -q -c 2 -W 1 172.22.80.7 &> /dev/null insertstatus nautilus +there_state=$? + +if [ $global_state -eq 0 ]; then + if [ $there_state -eq 0 ]; then + apistatus open + else + apistatus closed + fi +else + apistatus unknown +fi + exit 0 -- cgit v1.2.1