#!/bin/bash
export LANG=C
unset port

while test -z "$port" ; do
   port=$RANDOM
   if [ $port -lt 1025 ] || netstat -a -n | grep -q :$port ; then
      unset port
   fi
done

clear
echo -e "\n\nThe XSP web server is starting now. To view the monodoc pages, your"
echo -e "web browser will open http://localhost:$port/ now.\n\n"

(sleep 5; sensible-browser http://localhost:$port/) &

exec xsp4 --root /usr/share/monodoc/web --port $port --address 127.0.0.1
