#!/bin/sh export PATH=/stand # set -o xtrace DISK=ad0 CDROM=acd0c MOUNT="mount_cd9660 /dev/${CDROM} /mnt" PERCENT=99 export PERCENT abort () { echo "Command failed .. it is senseless to continue - exiting." exit } echo echo 'ATTENTION! - This will format your disk '$DISK' !!!' echo echo 'TURN OFF THE PC NOW IF YOU ARE NOT SURE!' echo 'hit to continue ..' read answer $MOUNT || abort echo -n "Creating a dos compliant Partition Table ... " fdisk -BI ${DISK} || abort echo 'done!' echo -n "Writing a FreeBSD disklabel to start of 1st slice ... " disklabel -r -w -B ${DISK}s1 auto || abort echo 'done!' echo -n "Creating a root and a swap partition on 1st slice ... " export EDITOR=${PATH}/disklabeleditor disklabel -e ${DISK}s1 || abort echo 'done!' echo -n "newfs on ${DISK}s1a ... " newfs -U ${DISK}s1a || abort echo 'done!' echo -n "mounting of ${DISK}s1a over /tmp ... " mount /dev/${DISK}s1a /tmp || abort echo 'done!' echo -n "restoring of the neweye.dmp ... " cd /tmp || abort restore -rf /mnt/neweye.dmp || abort echo 'done!' echo -n "copying individual files ... " cp -R -p -f /sun/* /tmp/ echo -n "umounting /tmp ... " cd / umount /tmp || abort umount /mnt || abort echo 'done!' echo echo "Now reboot the PC without floppy or cdrom injected!"