0f75b2635e
'echo -n' is not a POSIX construct (no flag support), we shoud use 'printf', especially in init script. This patch was generated by the following command line: git grep -l 'echo -n' -- `git ls-files | grep -v 'patch'` | xargs sed -i 's/echo -n/printf/' Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
42 lines
730 B
Bash
Executable File
42 lines
730 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="-document_root /var/www -listening_port 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)
|
|
printf "Stopping $DESC: "
|
|
start-stop-daemon -K -x "$DAEMON"
|
|
echo "$NAME."
|
|
;;
|
|
restart|force-reload)
|
|
printf "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
|