summaryrefslogtreecommitdiff
blob: df0e6dbb27e054948afed7bbcf74445397c9bce3 (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
30
31
32
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-proxy/polipo/files/polipo.initd,v 1.1 2005/04/22 19:15:11 mrness Exp $

depend() {
	need net
}

start() {
	ebegin "Starting Polipo HTTP proxy"

	if [ ! -f "/etc/polipo/config" ]; then
		eerror "Unable to read configuration file: /etc/polipo/config"
		return 1
	fi

	start-stop-daemon --start --quiet --chuid polipo \
		--background --pidfile /var/run/polipo.pid --make-pidfile \
			--exec /usr/bin/polipo

	eend $?
}

stop() {
	ebegin "Stopping Polipo HTTP proxy"
	start-stop-daemon --stop --quiet --pidfile /var/run/polipo.pid
	eend $?

	[ -f /var/run/polipo.pid ] && rm /var/run/polipo.pid
}