blob: 24a17e2a0e2d6c8132e86482336de529f92a3708 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#!/bin/sh
#
# lighttpd
#
PATH=/usr/bin:/usr/sbin:/bin:/sbin
PREFIX="lighttpd: "
LIGHTTPD="/usr/sbin/lighttpd"
LIGHTTPD_CONF="/etc/lighttpd/lighttpd.conf"
start()
{
echo "${PREFIX}starting"
if start-stop-daemon --start --quiet --oknodo --exec ${LIGHTTPD} -- -f ${LIGHTTPD_CONF}; then
echo "${PREFIX}done"
else
echo "${PREFIX}error, could not start server"
fi
}
stop()
{
echo "${PREFIX}stoppping"
if start-stop-daemon --stop --quiet --oknodo --exec ${LIGHTTPD}; then
echo "${PREFIX}done"
else
echo "${PREFIX}error, could not stop server"
fi
}
case $1 in
start)
start
;;
stop)
stop
;;
restart|force-reload)
stop
sleep 1
start
;;
*)
echo "${PREFIX}usage: ${0} [start|stop|restart]"
exit 1
;;
esac
|