#!/bin/sh
#
# thttpd_wrapper - wrapper script for thttpd on FreeBSD 3.x
#
# This goes in /usr/sbin.  It runs thttpd in a loop.  If thttpd
# exits then the script restarts it automatically.
#
# The -D flag tells thttpd to *not* put itself into the background,
# and the -C flag tells it to get the rest of its configuration from
# the specified config file.

while true ; do
	/usr/sbin/thttpd -D -C /etc/thttpd.conf
	if [ -f /var/run/hcexit ]; then
		exit 0
	fi
	sleep 10
done
