SYBASE=`pwd`					; export SYBASE

SYBPLATFORM="linux"				; export SYBPLATFORM
LD_LIBRARY_PATH="$SYBASE/lib"			; export LD_LIBRARY_PATH
LC_ALL="default"				; export LC_ALL
unset LANG

PATH=$SYBASE/bin:$PATH				; export PATH

if [ ! "${PAGER}" ]; then
    PAGER=cat					; export PAGER
fi

# Have the README and WARNINGS at least presented once.
if [ ! -f ${SYBASE}/.readme ]; then
    ${PAGER} ${SYBASE}/README
    touch ${SYBASE}/.readme
    if [ `id -u` = 0 ]; then
	cat <<EOM

   WARNING: Before configuring this release of Sybase Adaptive Server
   Enterprise we strongly recommend you to run from an other login
   account then root.

   This because the SQL Server can be configured to operate on designated
   disk partitions resulting in data loss if the permissions are not
   setup properly.

EOM
	echo -n "Do you like to continue? [y/n]: "
	read ans
	case $ans in

		[Yy]*)	break ;;
		*)	exit ;;

	esac
    fi
fi

# Need to run sybinit 1st time
if [ ! -f ${SYBASE}/.sybinit ]; then
    echo ; echo -n "Do you want to start 'sybinit' now? [y/n]: "
    read ans
    case $ans in

   	[Yy]*) ${SYBASE}/install/sybinit
	       touch ${SYBASE}/.sybinit
	       exit 0 ;;

	*) echo ; echo "You can start it by hand later by executing"
	   echo "${SYBASE}/install/sybinit"

    esac
fi
