#!/bin/sh
#
# Start the local Meta-HTML Web Servers running.
#
PATH=/www/bin:$PATH
export PATH

# List of hostnames that should start their own copy of Mhttpd.
MHTTPD_HOSTS=`cat /www/bin/LOCAL-SITES`

# Start the mhttpd servers.
for site in $MHTTPD_HOSTS; do
  confdir=/www/$site/conf
  if [ -r $confdir/mhttpd.conf ]; then
    echo "Starting server for $site."
    (mhttpd --config $confdir/mhttpd.conf)
    sleep 1
  else
    echo "Cannot start server for $site: No file $confdir/mhttpd.conf."
  fi
done
