#!/bin/sh
#
# $Id: patch-addons,v 1.1 2002-03-20 16:24:37 cvs Exp $
#

CWD=`pwd`
DCACHE_HOME=`dirname $CWD`


rm -f /etc/dcache.conf
echo "DCACHE_HOME=$DCACHE_HOME" > /etc/dcache.conf


cp $DCACHE_HOME/jobs/dcache-pool /etc/init.d/dcache


case `uname -s` in
	Linux)	
		rm -f  /etc/init.d/rc3.d/S69dcache
		rm -f  /etc/init.d/rc2.d/S69dcache
				
		rm -f  /etc/init.d/rc3.d/K11dcache
		rm -f  /etc/init.d/rc2.d/K11dcache
		
		ln -s  /etc/init.d/dcache /etc/init.d/rc3.d/S69dcache
		ln -s  /etc/init.d/dcache /etc/init.d/rc2.d/S69dcache

		ln -s  /etc/init.d/dcache /etc/init.d/rc2.d/K11dcache
		ln -s  /etc/init.d/dcache /etc/init.d/rc2.d/K11dcache

		;;
	SunOS)
		rm -f /etc/rc2.d/S99dcache
		rm -f /etc/rc1.d/K36dcache
		
		ln -s /etc/init.d/dcache /etc/rc2.d/S99dcache
		ln -s /etc/init.d/dcache /etc/rc1.d/K36dcache
		;;
	IRIX*)
		rm -f /etc/rc2.d/S99dcache
		rm -f /etc/rc1.d/K04dcache
		
		ln -s /etc/init.d/dcache /etc/rc2.d/S99dcache
		ln -s /etc/init.d/dcache /etc/rc1.d/K04dcache
		;;
esac
