#!/bin/sh
#
if [ "`id -u`" != "0" ]; then
	echo "Sorry, this must be done as root."
	exit 1
fi
echo "You are about to extract the paobin distribution into ${DESTDIR:-/} - are you SURE"
echo -n "you want to do this over your installed system (y/n)? "
read ans
if [ "$ans" = "y" ]; then
	cat paobin.?? | tar --unlink -xpzf - -C ${DESTDIR:-/}

	kernel=${DESTDIR:-/}/kernel
	if [ -f $kernel ]; then
		chflags noschg $kernel
		mv $kernel ${kernel}.old
	fi
	install -c -m 555 -o root -g wheel -fschg ${kernel}.PAO $kernel
fi
