#!/bin/sh



if [ ! -d $ZEUSHOME/web/etc ]
then
 while [ 1 ] 
 do
    printf "Enter Zeus installation directory: "
    read ZEUSHOME

    if [ ! -d $ZEUSHOME/web/etc/ ]
    then
	echo "Supplied zeus install directory is incorrect"
    else
        break
    fi
 done
fi

touch $ZEUSHOME/web/etc/licence.key
if [ $? -ne 0 ]
then
  echo "You do not have filesystem permissions to alter $ZEUSHOME/web/etc/licence.key"
  exit 1
fi    


printf "Enter licence key: "
read KEY

if [ "$KEY" != "" ]
then
  echo "$KEY" > $ZEUSHOME/web/etc/licence.key
  if [ $? -eq 0 ]
  then
    echo "Key updated successfully"
  else
    echo "Key update failed"
  fi
fi
