SourceForge.net Logo

B.22. /etc/init.d/mini_httpd

#!/bin/ash

# GPL $Id: mini_httpd,v 1.2 2005/03/22 15:06:15 cvonk Exp $
# system init for HTTP(s) server (mini_httpd)

case "$1" in
    start)
        mini_httpd -C /etc/sysconfig/mini_httpd.conf
        ;;
    stop)
        killall mini_httpd 2>/dev/null
        ;;
    restart)
	$0 stop
	$0 start
	;;
    status)
        if pidof mini_httpd | sed "s/$$\$//" | grep -q [0-9] ; then
	    echo "running"
        else
	    echo "stopped"
        fi
        ;;
esac

Example B.22. /etc/init.d/mini_httpd