LIGHTTPD_CONF=/home/USERNAME/etc/lighttpd.conf
PIDFILE=/home/USERNAME/var/run/lighttpd.pid
case "$1" in
start)
echo "Starting Lighttpd"
/usr/local/sbin/lighttpd -f $LIGHTTPD_CONF
;;
stop)
echo "Stopping Lighttpd"
kill -9 `cat $PIDFILE`
ps axww | grep dispatch | egrep -v 'grep' | awk '{ print $1 }' | xargs kill -9
;;
restart)
echo "Restarting Lighttpd"
$0 stop
$0 start
;;
reload)
echo "Reloading config"
kill -HUP `cat $PIDFILE`
;;
*)
echo "Usage: lighttpdctl (start|stop|restart|reload)"
exit 1
;;
esac