diff --git a/src/resources/setup.sh b/src/resources/setup.sh index 1e67715..8a4c768 100644 --- a/src/resources/setup.sh +++ b/src/resources/setup.sh @@ -1,17 +1,23 @@ +PS1='$ ' TOMCAT_DST_FOLDER="tomcat" TOMCAT_VERSION="${tomcat.version}" -TOMCAT_PID_FILENAME="pid.txt" +TOMCAT_PID_FILENAME="tomcat.pid" SMARTGEAR_DISTRIBUTION_DIRECTORY="smartgears-distribution-${smartgear.version}" SMARTGEAR_ROOT=${PWD} -GHN_HOME=${SMARTGEAR_ROOT}/${SMARTGEAR_DISTRIBUTION_DIRECTORY} +BUNDLE_HOME=${SMARTGEAR_ROOT} +STARTUP_SCRIPT="startContainer.sh" +STOP_SCRIPT="stopContainer.sh" + +GHN_HOME=${SMARTGEAR_ROOT}/SmartGears CONTAINER_FILENAME="container.xml" CONTAINER_XML=${GHN_HOME}/${CONTAINER_FILENAME} ENV_VARIABLES="export CATALINA_OPTS=\"-Xmx2000m -Xms2000m\" export GHN_HOME=${GHN_HOME} export CATALINA_PID=${SMARTGEAR_ROOT}/${TOMCAT_PID_FILENAME} -export CATALINA_HOME=${SMARTGEAR_ROOT}/${TOMCAT_DST_FOLDER}" +export CATALINA_HOME=${SMARTGEAR_ROOT}/${TOMCAT_DST_FOLDER} +export BUNDLE_HOME=${SMARTGEAR_ROOT}" function showhelp { @@ -94,8 +100,8 @@ fi echo "- Modify ${CONTAINER_XML} with your hostname" echo "- Modify ${CONTAINER_XML} startup infrastructure and vres" -CATALINA_STARTUP_SCRIPT="${TOMCAT_DST_FOLDER}/bin/startup.sh" -echo "- Launch Tomcat from ${SMATGEAR_ROOT} using the command ${CATALINA_STARTUP_SCRIPT}" +echo "- You can Start the container from ${BUNDLE_HOME} directory using the command ./${STARTUP_SCRIPT}" +echo "- You can Stop the container from ${BUNDLE_HOME} directory using the command ./${STOP_SCRIPT}" echo "" echo "PLEASE NOTE: diff --git a/src/resources/startContainer.sh b/src/resources/startContainer.sh new file mode 100755 index 0000000..c20ccd0 --- /dev/null +++ b/src/resources/startContainer.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd $BUNDLE_HOME +$CATALINA_HOME/bin/startup.sh diff --git a/src/resources/stopContainer.sh b/src/resources/stopContainer.sh new file mode 100755 index 0000000..ed8a311 --- /dev/null +++ b/src/resources/stopContainer.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd $BUNDLE_HOME +$CATALINA_HOME/bin/shutdown.sh -force