#!/bin/sh

ROOT="./"
PORT=8000

# Usage [path] [port]

if [ ! "$1" = "" ]; then
	ROOT=$1
fi

if [ ! "$2" = "" ]; then
	PORT=$2
fi

echo "
nologs
noresolv
env WWWROOT ${ROOT}
listen inet 0.0.0.0 $PORT screws
addmod unicode
addmod Mime
addmod noupdir
addmod HsmlExec
setuid @* screws
"| screwsd -c -

if [ "$?" = "127" ]; then
	echo "Error. Usage $0 [path] [port]"
fi
