#!/bin/sh # # Start the AOLServer HTTP server. # NAME=dotlrn USER=www-data GROUP=www-data ADDRESS=0.0.0.0 PORT=80 PATH=/bin:/usr/bin:/sbin:/usr/sbin DAEMON=/usr/sbin/aolserver4-nsd PIDFILE=/var/run/aolserver4/$NAME.pid CONF=/etc/aolserver4/aolserver4.tcl trap "" 1 [ -f $DAEMON ] || exit 0 start() { echo -n "Starting web server: $NAME" start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PIDFILE --oknodo -- \ -u $USER -g $GROUP -b $ADDRESS:$PORT -s $NAME -t $CONF >/dev/null 2>&1 if [ $? != 0 ]; then echo " ... failed" exit 1 else echo "." fi } stop() { echo -n "Stopping web server: $NAME" start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo >/dev/null 2>&1 if [ $? != 0 ]; then echo " ... failed" exit 2 else echo "." fi } case "$1" in start) start ;; stop) stop ;; reload|force-reload|restart) stop sleep 2 start ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" exit 1 ;; esac exit 0