buildrootschalter/package/mongoose/S85mongoose
Davide Viti be1cf3bad4 mongoose: wait some time between stop and start of the service
Startup script fails to restart the service: 1s delay is enough to fix
this.

Also apply a minor fix of the script name in the usage string

Signed-off-by: Davide Viti <d.viti@infosolution.it>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-26 12:42:37 +01:00

42 lines
748 B
Bash
Executable File

#!/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`
OPTIONS="-num_threads 3 -document_root /var/www -listening_ports 80"
[ -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"
sleep 1
start-stop-daemon -S -x "$DAEMON" -b -- $OPTIONS
echo "$NAME."
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0