LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   lighttpd startup script (https://www.linuxquestions.org/questions/slackware-14/lighttpd-startup-script-456305/)

Feinom 06-19-2006 02:28 PM

lighttpd startup script
 
Hey!
I made a startup script for lighttpd, and thought I'd share it in case anyone else wants to use it... I know it lacks commenting, but I just don't care ;)
Just modify it to fit your configuration :-)

rc.lighttpd :
Quote:

lighttpd_start() {
if [ -x /usr/local/sbin/lighttpd ]; then
if ! `test -e /var/run/lighttpd.pid`; then
/usr/local/sbin/lighttpd -f /etc/lighttpd.conf
echo "Starting lighttpd"
else
echo "Lighttpd is already running!"
fi
fi
}

lighttpd_stop() {
echo "Stopping lighttpd"
killall lighttpd
}

lighttpd_restart() {
lighttpd_stop
sleep 1
lighttpd_start
}

case "$1" in
'start')
lighttpd_start
;;
'stop')
lighttpd_stop
;;
'restart')
lighttpd_restart
;;
*)
echo "usage $0 start|stop|restart"
;;
esac


All times are GMT -5. The time now is 06:49 PM.