#!/usr/bin/qsh
#
# //  DESCRIPTION:
# //      Script used to display the version information for the product.

WAS_OS400_FILE_CREATE_AUTH="*RX"
WAS_OS400_DIR_CREATE_AUTH="*RX"


. $(/usr/bin/dirname $0)/setupCmdLine

# // Begin: Disable Postinstaller options
# // If runConfigActions.disableAlways file exists, just exit RC=0
# // This flag will disable runConfigActions completely. 
disableAlways=${USER_INSTALL_ROOT}/properties/service/runConfigActions.disableAlways
if [ -f $disableAlways ]; then
	exit 0
fi
# // If runConfigActions.disableAtServerStartup exists AND this script was called by startServer, exit RC=0
# // This allows the script to be skipped at server startup but run manually. 
startServer=$1
disableSS=${USER_INSTALL_ROOT}/properties/service/runConfigActions.disableAtServerStartup
if [[ -f $disableSS  &&  $startServer = "-startServer" ]]; then
	exit 0
fi
# // End : Disable Postinstaller options

WAS_CLASSPATH=${WAS_CLASSPATH}:\
${WAS_INSTALL_ROOT}/properties/service/postinstaller/lib/postinstaller_mp.jar:\
${WAS_INSTALL_ROOT}/properties/service/postinstaller/lib/com.ibm.ws.runtime.postinstaller.jar:\
${WAS_INSTALL_ROOT}/plugins/com.ibm.ws.runtime.os400.jar:\
${WAS_INSTALL_ROOT}/plugins/com.ibm.ws.bootstrap.os400.jar

if [ -f ${JAVA_HOME}/bin/java ]; then
 JAVA_EXE="${JAVA_HOME}/bin/java"
else
 JAVA_EXE="${JAVA_HOME}/jre/bin/java"
fi

${JAVA_EXE} ${JAVA_PARM} \
$JVM_EXTRA_CMD_ARGS \
-classpath ${WAS_CLASSPATH} \
-DWAS_HOME=${WAS_HOME} \
-DUSER_INSTALL_ROOT=${USER_INSTALL_ROOT} \
-Djava.endorsed.dirs=${JAVA_ENDORSED_DIRS} \
-Dos400.file.create.auth=${WAS_OS400_FILE_CREATE_AUTH} \
-Dos400.dir.create.auth=${WAS_OS400_DIR_CREATE_AUTH} \
com/ibm/ws/os400/tools/RunConfigAction $@

