summaryrefslogtreecommitdiffstats
path: root/extra/mini_httpd/mini_httpd.initd
blob: ccaf53d31fe8d185a44e22e98eb7fab703352b09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/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
}