28 lines
443 B
Bash
28 lines
443 B
Bash
#! /bin/sh
|
|
|
|
set -e
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Starting webserver: "
|
|
#webserver will drop root priviledges after binding
|
|
start-stop-daemon -S -b -a /bin/webserver
|
|
echo "done"
|
|
;;
|
|
stop)
|
|
echo -n "Stopping webserver: "
|
|
start-stop-daemon -K -n webserver
|
|
echo "done"
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
$0 start
|
|
;;
|
|
*)
|
|
echo "Usage webserver { start | stop | restart }" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|