#!/bin/bash WEB=$1 TMP=.status.tmp curl -m 10 -s -o $TMP $WEB STATUS=$(grep "Termination Status" $TMP | perl -pe "s/.*\(.+)\<.*/\1/" ) REV=$(grep "Updating " $TMP | grep -Eo "[[:alnum:]]{7}\.\.[[:alnum:]]{7}") if [ "$STATUS" == "Success" ]; then STATUS="fin" elif [ "$STATUS" == "running..." ]; then STATUS="run" fi if [ "$REV" = "" ]; then REV="(uncond)" fi echo "$STATUS;r$REV"