#! /bin/sh
# This script restores files back to hardlinks. 
#
#
 
if [ "$ROOTDIR" != "" ]; then
	INSTALLF="installf -R ${ROOTDIR}"
        REMOVEF="removef -R ${ROOTDIR}"
else
	INSTALLF="installf"
        REMOVEF="removef"
fi



pkginfo -R $ROOTDIR -q  SUNWsfdrr 
if [ $? -eq 0 ]
then
    ${REMOVEF} SUNWsfdrr /etc/rc0.d/K40sf880dr > /dev/null 2>&1
    ${REMOVEF} SUNWsfdrr /etc/rc1.d/K40sf880dr > /dev/null 2>&1
    ${REMOVEF} SUNWsfdrr /etc/rc2.d/S77sf880dr > /dev/null 2>&1
    ${REMOVEF} SUNWsfdrr /etc/rcS.d/K40sf880dr > /dev/null 2>&1
    ${REMOVEF} -f SUNWsfdrr || exit 2

# Now re-add them back as hard links to /etc/init.d/sf880dr.

    ${INSTALLF} SUNWsfdrr /etc/rc0.d/K40sf880dr=$ROOTDIR/etc/init.d/sf880dr l > /dev/null 2>&1
    ${INSTALLF} SUNWsfdrr /etc/rc1.d/K40sf880dr=$ROOTDIR/etc/init.d/sf880dr l > /dev/null 2>&1
    ${INSTALLF} SUNWsfdrr /etc/rc2.d/S77sf880dr=$ROOTDIR/etc/init.d/sf880dr l > /dev/null 2>&1
    ${INSTALLF} SUNWsfdrr /etc/rcS.d/K40sf880dr=$ROOTDIR/etc/init.d/sf880dr l > /dev/null 2>&1
    ${INSTALLF} -f SUNWsfdrr || exit 2
     
fi


exit 0
