#! /bin/sh
#
#
#
# Asks user if he would like to continue.  It will timeout in
# SLEEP_TIME and the backout will continue if no response is given.
#
SLEEP_TIME=120
times_up()
{
	exit 0
}

trap 'times_up' ALRM
( sleep $SLEEP_TIME ; kill -ALRM $$ ) &
child_pid=$!

echo ""
echo ""
echo "	   Removing this Supplemental patch will remove the changes that"
echo "	   address the issues described in the README for this"
echo "	   Supplemental patch."
echo ""
echo "	   Please note that if you are about to install a later release"
echo "	   of the Kernel Update patch, that this later release may not"
echo "	   include all the changes that are provided by this Supplemental "
echo "	   patch."
echo ""
echo "	   As such you are advised to review the README for the"
echo "	   Supplemental patch being removed and the Kernel Update patch"
echo "	   which you are about to install.  It may be necessary to"
echo "	   additionally install the Supplemental patch corresponding to "
echo "	   the later Kernel Update patch. "
echo ""
echo ""

echo "Do you wish to continue removing this patch {yes or no} [yes]? \\c"
echo "\n(by default, installation will continue in $SLEEP_TIME seconds)"

read Response
while [ 1 ]
do
	case $Response in
		n | no | N | NO | No)
			kill -9 $child_pid
			exit 1 ;;
		"" | y | yes | Y | Yes | YES)
			kill -9 $child_pid
			exit 0 ;;
		*)  echo "yes or no please. \\c"
			read Response ;;
	esac
done
exit 0
