wok view lighttpd/stuff/etc/init.d/lighttpd @ rev 24

Add : lighttpd Web server with stuff
author Christophe Lincoln <pankso@slitaz.org>
date Tue Dec 18 13:51:14 2007 +0100 (2007-12-18)
parents
children 36897b07aa3c
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