#!/bin/bash

. /usr/local/lib/labtool.shlib
trap on_exit EXIT

#DEBUG=true
STATION_NUM="$(hostname -s | grep -o "[0-9]*")"
STANDARD_URL="http://server${STATION_NUM}.example.com/d.html"
SECURE_URL="https://server${STATION_NUM}.example.com/d.html"



check_root

check_host "desktop"

echo -n "* Checking for standard web server... "
if wget -q $STANDARD_URL ; then
    echo "PASS"
else
    echo "FAIL"
    echo "Cannot connect to $STANDARD_URL"
fi


echo -n "* Checking for secure web server... "
if wget -q --no-check-certificate $SECURE_URL ; then
    echo "PASS"
else
    echo "FAIL"
    echo "Cannot connect to $SECURE_URL"
fi

exit
