From: Christian Pointner Date: Fri, 5 Jun 2009 15:41:21 +0000 (+0000) Subject: added shell script to update web status X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=607de0502e7028837b76b85e127d83bcb52d6b4e;p=svn42.git added shell script to update web status --- diff --git a/update-web-status.sh b/update-web-status.sh new file mode 100755 index 0000000..81c5ff1 --- /dev/null +++ b/update-web-status.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +URL_OPENED='https://www.realraum.at/cgi/status.cgi?pass=jako16&set=%3Chtml%3E%3Cbody%20bgcolor=%22lime%22%3E%3Ccenter%3E%3Cb%3ET%26uuml%3Br%20ist%20Offen%3C/b%3E%3C/center%3E%3C/body%3E%3C/html%3E' +URL_CLOSED='https://www.realraum.at/cgi/status.cgi?pass=jako16&set=%3Chtml%3E%3Cbody%20bgcolor=%22red%22%3E%3Cb%3E%3Ccenter%3ET%26uuml%3Br%20ist%20Geschlossen%3C/center%3E%3C/b%3E%3C/body%3E%3C/html%3E' + +if [ -z "$1" ]; then + echo "Usage: update-web-status.sh (open|close)" + exit 1 +fi + +case "$1" in + open) + wget --no-check-certificate -O /dev/null $URL_OPENED > /dev/null 2>&1 + ;; + close) + wget --no-check-certificate -O /dev/null $URL_CLOSED > /dev/null 2>&1 + ;; + *) + echo "Invalid argument '$1' != (open|close)" + exit 1; + ;; +esac + +if [ $? -ne 0 ]; then + echo "Error" + exit 2 +fi + +echo "Ok" +exit 0