summaryrefslogtreecommitdiff
path: root/scripts/pingscript
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2011-03-18 23:28:52 +0100
committerroot <root@oberon.sublab.org>2011-03-19 13:17:49 +0100
commit5ee8fd94512d7f4ea7d49310dc8e1151ef833cac (patch)
tree0eff21b44c1491e6197d9b99b0df13ebed324361 /scripts/pingscript
Initial commit
Diffstat (limited to 'scripts/pingscript')
-rwxr-xr-xscripts/pingscript30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/pingscript b/scripts/pingscript
new file mode 100755
index 0000000..f6671b4
--- /dev/null
+++ b/scripts/pingscript
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+. settings
+
+logger -t sublab-updater starting status update
+
+insertstatus() {
+ local status
+ if [ $? -eq 0 ]; then
+ status=online
+ else
+ status=offline
+ 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
+}
+
+# Ping Taifun
+ping -q -c 2 -W 1 172.22.83.5 &> /dev/null
+insertstatus taifun
+
+# Ping Trieste
+ping -q -c 2 -W 1 172.22.80.4 &> /dev/null
+insertstatus trieste
+
+# Ping Nautilus
+ping -q -c 2 -W 1 172.22.80.7 &> /dev/null
+insertstatus nautilus
+
+exit 0