aboutsummaryrefslogblamecommitdiffstats
path: root/extra/mini_httpd/mini_httpd.initd
blob: ccaf53d31fe8d185a44e22e98eb7fab703352b09 (plain) (tree)




























                                                                                                                       
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/mini_httpd/files/mini_httpd.init,v 1.2 2007/08/26 21:20:21 bangert Exp $

depend() {
	need net
}

start() {
	ebegin "Starting mini_httpd"
	if [ ! -d "$MINI_HTTPD_DOCROOT" ]; then
		eend 1 "MINI_HTTPD_DOCROOT not set correctly in /etc/conf.d/mini_httpd"
		exit 1
	fi
	start-stop-daemon --quiet --start --startas /usr/sbin/mini_httpd \
		--pidfile /var/run/mini_httpd.pid -- ${MINI_HTTPD_OPTS}
	eend $?
}

stop() {
	local rc

	ebegin "Stopping mini_httpd"
	start-stop-daemon --quiet --stop --pidfile /var/run/mini_httpd.pid
	rc=$?
	rm -f /var/run/mini_httpd.pid
	eend $rc
}