wok-4.x view lighttpd/stuff/etc/init.d/lighttpd @ rev 6573

lighttpd: fix 36897b07aa3c commit
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Oct 08 21:28:00 2010 +0200 (2010-10-08)
parents 36897b07aa3c
children 975c0719444a
line source
1 #!/bin/sh
2 # /etc/init.d/lighttpd: Start, stop and restart web server on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 . /etc/daemons.conf
9 NAME=LightTPD
10 DESC="web server"
11 DAEMON=/usr/sbin/lighttpd
12 OPTIONS=$LIGHTTPD_OPTIONS
13 PIDFILE=/var/run/lighttpd.pid
15 case "$1" in
16 start)
17 if [ -f $PIDFILE ] ; then
18 echo "$NAME already running."
19 exit 1
20 fi
21 echo -n "Starting $DESC: $NAME... "
22 $DAEMON $OPTIONS
23 status
24 ;;
25 stop)
26 if [ ! -f $PIDFILE ] ; then
27 echo "$NAME is not running."
28 exit 1
29 fi
30 echo -n "Stopping $DESC: $NAME... "
31 kill `cat $PIDFILE`
32 rm $PIDFILE
33 status
34 ;;
35 restart)
36 if [ ! -f $PIDFILE ] ; then
37 echo "$NAME is not running."
38 exit 1
39 fi
40 echo -n "Restarting $DESC: $NAME... "
41 kill `cat $PIDFILE`
42 rm $PIDFILE
43 sleep 2
44 $DAEMON $OPTIONS
45 status
46 ;;
47 *)
48 echo ""
49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
50 echo ""
51 exit 1
52 ;;
53 esac
55 exit 0