summaryrefslogtreecommitdiff
blob: fd9cbad07caaf83e1b8747bcbb63b3f6d14407a3 (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
36
37
38
39
#!/sbin/runscript
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Id$

extra_started_commands="reload"

depend() {
	need net
}

start_pre() {
	# Create directory for PID file
	checkpath -d -q "$(dirname ${ACCEL_PPPD_PID})"
	# Create default directory for radius attributes
	checkpath -d -q "${RADATTR_DIR}"
}

start() {
	ebegin "Starting accel-pppd"
	start-stop-daemon --start --quiet --exec /usr/sbin/accel-pppd -- ${ACCEL_PPPD_OPTS} -p ${ACCEL_PPPD_PID}
	eend $?
}

stop() {
	ebegin "Stopping accel-pppd"
	start-stop-daemon --stop --quiet --pidfile ${ACCEL_PPPD_PID}
	eend $?
}

reload() {
	if [ ! -f ${ACCEL_PPPD_PID} ]; then
		eerror "accel-pppd isn't running"
		return 1
	fi
	ebegin "Reloading configuration"
	start-stop-daemon --signal USR1 --pidfile ${ACCEL_PPPD_PID}
	eend $?
}