:
: Get an image of a system crash into a
: core file and a system file.
:
: jam 840104
: megamunging bog 850814 -- allow links to other unixes if none is on the tape.
:
if test x$1 = x
then
	echo "Usage:  getimage  name    [ where name = mmddX ]"
else
	echo -n "Hit return when tape drive is online: "
	getline
	echo "Retrieving vmcore.$1"
	dd if=/dev/rmt1600nr of=vmcore.$1 bs=16k
	echo "Retrieving vmunix.$1"
	tar xv vmunix etc/configuration etc/rc etc/rc.local
	if [ \! -s vmunix ]
	then
		echo "No vmunix on the tape. We have a bunch on line."
		ls vmunix.* | awk '{print "	" $1}'
		echo -n "Enter one of these names or just hit return: "
		link=`getline`
		if [ -s $link ]; then
			ln -s $link vmunix.$1
			ls -l vmunix.$1
		else
			echo "No link made."
			echo "Make sure the unix you need is around."
		fi
	else
		mv vmunix vmunix.$1
	fi
	sync
fi
