#! /bin/bash
#
# (C) 2008, ETH Zurich, CISD
#
# Script for maintaining the password file.
# 
# Note that the password file and consequenctly this script 
# are only relevant if you set in the service.properties file
#
# authentication-service = file-authentication-service
#    
# -----------------------------------------------------------

#
# change to installation directory
#
bin=$0
if [ -L $bin ]; then
  bin=`dirname $bin`/`readlink $bin`
fi
WD="`dirname $bin`"
cd "$WD/.."

JAVA_BIN="$JAVA_HOME/bin/java"

if [ ! -x "$JAVA_BIN" ]; then
  echo "No java runtime environment executable found. You need to set the environment variable JAVA_HOME appropriately."
  exit 1
fi

$JAVA_HOME/bin/java -cp webapps/openbis/WEB-INF/lib/commons-lang.jar:webapps/openbis/WEB-INF/lib/commons-io.jar:webapps/openbis/WEB-INF/lib/commons-codec.jar:webapps/openbis/WEB-INF/lib/args4j.jar:webapps/openbis/WEB-INF/lib/jline.jar:webapps/openbis/WEB-INF/lib/log4j.jar:webapps/openbis/WEB-INF/lib/openBIS.jar ch.systemsx.cisd.authentication.file.PasswordEditorCommand "$@"
