#!/bin/ash
#
#
#
 . /etc/httpd/thttpd.conf
 if [ ! -e /etc/inetd/http.conf ]; then
   if [ ! -e $PID ]; then
     echo "Your HTTP Server seems to be down."
     read -p "Do you wish to start it now (y/n)?: " CHOICE1
     CHOICE1=y$CHOICE1
     if [ $CHOICE1 = yy ]; then
       httpd start
     fi
   fi
 fi
 . /etc/server/daemon.conf
 . /etc/httpd/httpd.port
 echo "Choose the test which you want to run:"
 echo "1) HTTP protocol"
 echo "2) HTTPS protocol"
 echo "3) Private web"
 echo "4) CGI Script (BusyBox)"
 echo "5) CGI Script (Perl)"
 read -p "Your choice (1,2,3,4,5)?: " CHOICE2 
 case "$CHOICE2" in
 '1')
 links http://localhost:$PORT/test.html
 ;;
 '2')
 links -ssl.certificates 0 https://localhost/test.html
 ;;
 '3')
 clear
 echo ""
 echo "The default login data are as follows:"
 echo "USER ID = user"
 echo "Password = 1234"
 echo ""
 read -p "Press Enter to continue..."
 links http://localhost:$PORT/private/test.html
 ;;
 '4')
 links http://localhost:$PORT/cgi-bin/bash.cgi
 ;;
 '5')
 links http://localhost:$PORT/cgi-bin/perl.cgi
 ;;
 *)
 echo "Bye!"
 ;;
 esac