Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Johan S�rensen's lighttpd control script (See related posts)

#!/bin/sh

LIGHTTPD_CONF=/home/jarkko/domains/piforienteering.fi/sites/piffen-new/config/lighttpd.conf
PIDFILE=/home/jarkko/var/run/lighttpd.pid

case "$1" in
    start)
      # Starts the lighttpd deamon
      echo "Starting Lighttpd"
      lighttpd -f $LIGHTTPD_CONF
    
  ;;
    stop)
      # stops the daemon bt cat'ing the pidfile
      echo "Stopping Lighttpd"
      kill `cat $PIDFILE`
  ;;
    restart)
        ## Stop the service regardless of whether it was
        ## running or not, start it again.
        echo "Restarting Lighttpd"
        $0 stop
        $0 start
  ;;
    reload)
      # reloads the config file by sending HUP
      echo "Reloading config"
      kill -HUP `cat $PIDFILE`
  ;;
    *)
            echo "Usage: lighttpdctrl (start|stop|restart|reload)"
            exit 1
        ;;
esac

You need to create an account or log in to post comments to this site.


Related Posts