summaryrefslogtreecommitdiff
blob: 4ae145fbc80921f24754a06639d76cbe2cbc31ff (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
33
34
35
#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

depend() {
	use net
}

checkconfig() {
	if [[ ! -d /var/run/p3scan ]] ; then
		checkpath -q -d -m 0700 -o mail:mail /var/run/p3scan || return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting p3scan"
	start-stop-daemon --start --quiet --pidfile /var/run/p3scan/p3scan.pid --exec /usr/sbin/p3scan
	eend $?
}

stop() {
	ebegin "Stopping p3scan"
	start-stop-daemon --stop --quiet --pidfile /var/run/p3scan/p3scan.pid
	eend $?
}

restart() {
	ebegin "Restarting p3scan"
	svc_stop
	sleep 1
	svc_start
	eend $?
}