#!/bin/csh
#
# This script will create links from /usr/Essetial/hippi/bin/* to 
# /usr/etc and then it will link /usr/Essential/hippi/man/* to
# /usr/share/catman/a_man/cat1
# 

# Change into /usr/Essential/hippi/bin
cd /usr/Essential/hippi/bin

# Make a link for all files in /usr/Essential/hippi/bin to 
# /usr/etc

foreach x ( * )
    if ( -l /usr/etc/$x ) then
        /bin/rm -f /usr/etc/$x
    endif
    
    /bin/ln -s /usr/Essential/hippi/bin/$x /usr/etc/$x
    
end

# change directory to /usr/Essential/hippi/man and make a link to 
# /usr/share/catman/a_man/cat1
# 

cd /usr/Essential/hippi/man

foreach x ( * )
    if ( -l /usr/share/catman/a_man/cat1/$x ) then
        /bin/rm -f /usr/share/catman/a_man/cat1/$x
    endif
        
    /bin/ln -s /usr/Essential/hippi/man/$x /usr/share/catman/a_man/cat1/$x
   
end

# change to /etc/rc2.d and make links back to /etc/init.d/Essnic.pre and 
# Essnic.post
# 

cd /etc/rc2.d

if ( -l /etc/rc2.d/S29hippi ) then
    /bin/rm -f /etc/rc2.d/S29hippi
endif

if ( -l /etc/rc2.d/S31hippi ) then
    /bin/rm -f /etc/rc2.d/S31hippi
endif

/bin/ln -s /etc/init.d/Essnic.pre S29hippi
/bin/ln -s /etc/init.d/Essnic.post S31hippi

exit(0)
