2012-12-12 13:03:16 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Start/stop the mongoose HTTP server
|
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
|
|
NAME=mongoose
|
|
|
|
DESC="Mongoose HTTP server"
|
|
|
|
|
|
|
|
DAEMON=`which mongoose`
|
2013-11-25 10:03:23 +01:00
|
|
|
OPTIONS="-num_threads 3 -document_root /var/www -listening_ports 80"
|
2012-12-12 13:03:16 +01:00
|
|
|
|
|
|
|
[ -e /etc/default/mongoose ] && . /etc/default/mongoose
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo "Starting $DESC:"
|
|
|
|
start-stop-daemon -S -x "$DAEMON" -b -- $OPTIONS
|
|
|
|
echo "$NAME."
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
echo -n "Stopping $DESC: "
|
|
|
|
start-stop-daemon -K -x "$DAEMON"
|
|
|
|
echo "$NAME."
|
|
|
|
;;
|
|
|
|
restart|force-reload)
|
|
|
|
echo -n "Restarting $DESC: "
|
|
|
|
start-stop-daemon -K -x "$DAEMON"
|
2013-11-25 14:55:25 +01:00
|
|
|
sleep 1
|
2012-12-12 13:03:16 +01:00
|
|
|
start-stop-daemon -S -x "$DAEMON" -b -- $OPTIONS
|
|
|
|
echo "$NAME."
|
|
|
|
;;
|
|
|
|
*)
|
2013-11-25 14:55:25 +01:00
|
|
|
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
|
2012-12-12 13:03:16 +01:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|