#!/sbin/runscript # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-fs/coda/files/coda-update,v 1.1 2004/03/23 20:18:49 dragonheart Exp $ depend() { need net auth2 } we_are_scm() { if [ "`cat /var/lib/vice/hostname`" = "`cat /var/lib/vice/db/scm`" ] ; then return 0 else return 1 fi } checkconfig() { if [ ! -e /var/lib/vice/hostname ] ; then eerror "Please set up coda before starting the service..." return 1 fi } start() { checkconfig || return 1 ebegin "Starting coda update servers" # Check to see if we are the SCM. if we_are_scm ; then start-stop-daemon --start --quiet --exec /usr/sbin/rpc2portmap start-stop-daemon --start --quiet --exec /usr/sbin/updatesrv fi start-stop-daemon --start --quiet --exec /usr/sbin/updateclnt eend $? } stop() { ebegin "Stopping coda-update" if we_are_scm ; then start-stop-daemon --stop --quiet --exec /usr/sbin/rpc2portmap start-stop-daemon --stop --quiet --exec /usr/sbin/updatesrv fi start-stop-daemon --stop --quiet --exec /usr/sbin/updateclnt eend $? }