#! /bin/sh

##
## Copyright 2006, (C) BASEMENT SUPERCOMPUTING 
## All rights reserved.
##
## BASEMENT SUPERCOMPUTING PROPRIETARY INFORMATION
## This software is supplied under the terms of a license agreement
## or nondisclosure agreement with BASEMENT SUPERCOMPUTING and may not be
## copied or disclosed except in accordance with the terms of that
## agreement.
##
## ANY ATTEMPT TO EVADE THIS INSTALLATION PROCESS RESULTS IN IMMEDIATE
## CANCELLATION OF ANY AND ALL LICENSE TO USE BERT 77

if test `whoami` != "root" ; then
    echo
    echo "You must be root to install BERT 77"
    echo "See README.bert"
    echo 
    exit 1
fi
if test "$BERT" = "" ; then
    echo
    echo "Please define BERT environment variable."
    echo "(export BERT=/opt/bert/bin usually works)"
    echo
    exit 1
fi
if [ ! -e $BERT/../doc/LICENSE.bert ]
then
   echo "No License File. Please make sure BERT environment variable
points to ~/bert/bin or ~/bert_lite/bin directory"
   exit 1
fi

more $BERT/../doc/LICENSE.bert
echo "Do you accept these terms? [accept,decline]"
read ans
if test "$ans" != "accept" ; then
    echo
    echo "Please Remove all copies of BERT 77."
    echo "Contact Basement Supercomputing with any questions."
    echo
    exit 1
fi
# RENAMING THESE FILES WITHOUT THE USE OF THIS SCRIPT IS
# A VIOLATION OF THE LICENSE AGREEMENT

/bin/mv $BERT/.xbert $BERT/xbert
/bin/mv $BERT/.bert $BERT/bert
/bin/mv $BERT/.bertd $BERT/bertd
/bin/touch $BERT/.xbert
/bin/touch $BERT/.bert
/bin/touch $BERT/.bertd
echo
echo "BERT 77 is now ready to run. Please re-type 'bertd' to 
start the daemon. The license agreement is in bert/doc/LICENSE.bert.
You will not see these messages again. Thank you."
echo
