Skip to content

Instantly share code, notes, and snippets.

@ttimot24
Last active November 18, 2020 14:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ttimot24/175e99b3e46882bfad759ee942a135a9 to your computer and use it in GitHub Desktop.
Save ttimot24/175e99b3e46882bfad759ee942a135a9 to your computer and use it in GitHub Desktop.
GlassFish installer
echo "----------------------------------------------"
echo "| GlassFish installer |"
echo "| by: Timot Tarjani - version: 1.2 |"
echo "----------------------------------------------"
if [ -z ${1+x} ]; then
echo "Please pass version as first argument!";
exit 1;
else
export GLASSFISH_VERSION=$1
fi;
#wget http://download.oracle.com/glassfish/${GLASSFISH_VERSION}/nightly/latest-glassfish.zip
wget https://download.eclipse.org/ee4j/glassfish/glassfish-${GLASSFISH_VERSION}.zip -O latest-glassfish.zip
if [ ! -f latest-glassfish.zip ]; then
echo "Failed to download Glassfish. Requested version: ${GLASSFISH_VERSION}";
exit 1;
fi;
export INSTALL_DIR=$(unzip -qql latest-glassfish.zip | sed -r '1 {s/([ ]+[^ ]+){3}\s+//;q}' | sed -e 's/\/$//' )
echo "Unzipping ${INSTALL_DIR}..."
unzip -q latest-glassfish.zip
rm latest-glassfish.zip
./${INSTALL_DIR}/bin/asadmin start-domain --verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment