#!/bin/sh
# @(#) $RCSfile: MENU_OVERWRITE,v $: $Revision: #4 $, $Date: 2006/06/26 $ 
# @(#) Copyright (c), 1987, 2006 Insightful Corp.  All rights reserved.
# Checks if the Splus script will be overwritten

CONTINUE=T

# Source file with S-Plus Default Environment variables
. $SHOME/splus/lib/install/USER.env

cat << EOF


***** WARNING *****

EOF
    echo "$SPLUS_DEST/$SPLUS_SCRIPT already exists."
    cat << EOF
You can enter a new location for the script, enter a new name for the
script (e.g. nSplus) or overwrite the current script.

EOF

while [ "$CONTINUE" = "T" ]
do
     echo-n "Overwrite current Splus script [y/n]? "
     read SCRIPT_OVERWRITE
     case $SCRIPT_OVERWRITE in
       y) CONTINUE=F; SET_VARS SCRIPT_OVERWRITE ;;
       n) CONTINUE=F; MENU_DEST ;;
       *) echo "You must enter y or n" ;;
     esac
done

exit 0
