#!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-fs/coda/files/coda-update,v 1.4 2004/07/26 17:50:21 griffon26 Exp $ depend() { need net auth2 } start() { local vicedir=$(/usr/sbin/codaconfedit server.conf vicedir) if [ ! -e "$vicedir/hostname" ] ; then eerror "Please run vice-setup before starting the service..." return 1 fi ebegin "Starting coda-update" # Check to see if we are the SCM. if [ "$(< "$vicedir/hostname")" = "$(< "$vicedir/db/scm")" ] ; then start-stop-daemon --start --quiet --exec /usr/sbin/updatesrv fi start-stop-daemon --start --quiet --exec /usr/sbin/updateclnt eend $? } stop() { local vicedir=$(/usr/sbin/codaconfedit server.conf vicedir) ebegin "Stopping coda-update" if [ "$(< $vicedir/hostname)" = "$(< $vicedir/db/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 $? }