summaryrefslogtreecommitdiff
blob: 7677901ae4abb26f04b663b53c28f585dd4a48f3 (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/conserver/files/conserver.initd,v 1.2 2004/02/13 19:06:42 vapier Exp $

depend() {
	need clock
}

checkconfig() {
	if [ ! -e /etc/conserver/conserver.cf ] ; then
		eerror "You need to create /etc/conserver/conserver.cf first."
		eerror "A sample is placed there to be renamed and ajusted."
		eerror "Read the man page or see /usr/share/doc/conserver-<version>/."
		return 1
	fi

	if [ ! -e /etc/conserver/conserver.passwd ] ; then
		eerror "You need to create /etc/conserver/conserver.passwd first."
		eerror "A sample is placed there to be renamed and ajusted."
		eerror "Read the man page or see /usr/share/doc/conserver-<version>/."
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting conserver"
	start-stop-daemon --start --quiet --exec \
		/usr/sbin/conserver -- ${CONSERVER_OPTS} 1>/dev/null
	eend $? "Failed to start conserver"
}

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