summaryrefslogtreecommitdiff
blob: 639007b577ae624d33549dab93a9b87ccff64d19 (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-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dialup/xl2tpd/files/xl2tpd-init,v 1.2 2007/03/05 10:50:54 mrness Exp $

depend() {
	need net
}

checkconfig() {
	if [[ ! -f /etc/xl2tpd/xl2tpd.conf ]] ; then
		eerror "Missing /etc/xl2tpd/xl2tpd.conf configuration file!"
		eerror "Example configuration file could be found in doc directory."
		return 1
	fi

	return 0
}

start() {
	checkconfig || return 1

	ebegin "Starting xl2tpd"
	start-stop-daemon --start --quiet --exec /usr/sbin/xl2tpd
	eend $?
}

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