#!/bin/sh
set -u  # force better programming and ability to use check for not set
if [ "${1:-}" = "-x" ] ; then set -xv; shift; fi

output=${1:-/dev/tty}

node=`uname -n| sed -e 's/\([^\.]\)\..*/\1/'`

case $node in
gang=`gang`

cat << EOF
<html> <head> <title>$gang Cluster Enstore UP/DOWN Status Page</title> </head>
<body>
<body bgcolor="#ffffff" text=#a0a0ff">
<meta http-equiv="Refresh" content="900">
<h1><center>$gang Cluster Enstore UP/DOWN Fetch Begin: `date`</center></h1>
<hr>
<ul>
EOF

python $ENSTORE_DIR/src/enstore_up_down.py --html

echo "<hr>"

cat <<EOF
</ul>
<h1><center>$gang Cluster Enstore UP/DOWN Fetch Done : `date`</center></h1>
<hr>
</body>
EOF

# this is not robust.
enrcp ~/CRON/enstore_up_down-output d0ensrv2:/fnal/ups/prd/www_pages/enstore/up_down.html

