#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
#
# Special modified runonce version to repatition the disks after install
# It will the replace itself with the original version.
#

if [ -f /etc/redhat-release ]; then
    R=$(cat /etc/redhat-release)

    arch=$(uname -m)
    a="a"
    case "_$arch" in
	    _a*) a="an";;
	    _i*) a="an";;
    esac
    
    NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
    if [ "$NUMPROC" -gt "1" ]; then
        SMP="$NUMPROC-processor "
        if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
            a="an"
	else
	    a="a"
        fi
    fi

    # This will overwrite /etc/issue at every boot.  So, make any changes you
    # want to make to /etc/issue here or you will lose them when you reboot.
    echo "" > /etc/issue
    echo "$R" >> /etc/issue
    echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue

    cp -f /etc/issue /etc/issue.net
    echo >> /etc/issue
fi

rpm -Uvh /etc/FnaluBatch/configfiles/disk.cd.1part-1.0-2.i386.rpm

sed -e '/hdc1/s:/local/stage1:/usr/scratch/sect1:' /etc/fstab >/etc/fstab.tmp
sed -e '/hdd1/s:/local/stage2:/usr/scratch/sect2:' /etc/fstab.tmp >/etc/fstab.tmp2

mv /etc/fstab /etc/fstab.orig
mv /etc/fstab.tmp2 /etc/fstab
rm /etc/fstab.tmp

rm /etc/rc.d/rc.local
mv /etc/rc.d/rc.local.orig /etc/rc.d/rc.local
/sbin/reboot