summaryrefslogtreecommitdiff
blob: 7bf9fd4655a9e43cae4979055d9e0fcb15b1fea7 (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
40
41
42
43
44
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-fs/coda/files/6.0.15/codasrv,v 1.1 2008/07/12 22:31:41 chtekk Exp $

depend() {
	need net coda-update auth2
}

checkconfig() {
	if [ ! -e $vicedir/hostname ] ; then
		eerror "Please run vice-setup before starting the service..."
		return 1
	fi
}

we_are_scm() {
	if [ "`cat $vicedir/hostname`" = "`cat $vicedir/db/scm`" ] ; then
		return 0
	else
		return 1
	fi
}

getvicedir() {
        vicedir=`/usr/sbin/codaconfedit server.conf vicedir`
}

start() {
	getvicedir

	checkconfig || return 1

	ebegin "Starting codasrv"
	start-stop-daemon --start --background --exec /usr/sbin/codasrv
	eend $?
}

stop() {
	ebegin "Stopping codasrv"
	msg=`/usr/sbin/volutil shutdown 2>&1` || echo "$msg"
	start-stop-daemon --stop --quiet --retry 30/TERM --oknodo --exec /usr/sbin/codasrv
	eend $?
}