Fixed but with offline mode
@@ -15,7 +15,7 @@ ACTIVEMQ_GROUP=users
ACTIVEMQ_JAVA_HOME=""
ACTIVEMQ_INSTALL_VERSION=5.15.0
-if [ $# -eq 4 ] || [ $# -eq 6 ]
+if [ $# -eq 4 ]
then
echo "The active home folder is $1 "
ACTIVEMQ_INSTALL_HOME=$1
@@ -26,6 +26,10 @@ elif [ $# -eq 6 ] && ([ "$6" = "-o" ] || [ "$6" = "-O" ])
then
echo "Working in offline mode"
offline=true
+ ACTIVEMQ_INSTALL_HOME=$1
+ ACTIVEMQ_USER=$2
+ ACTIVEMQ_GROUP=$3
+ ACTIVEMQ_JAVA_HOME=$4
KYLO_SETUP_FOLDER=$5
else
echo "Unknown arguments. The first argument should be the path to the activemq home folder. Optional you can pass a second argument to set offline mode. The value is -o or -O "
@@ -47,16 +51,18 @@ linux_type=$(get_linux_type)
echo "Create the $ACTIVEMQ_INSTALL_HOME directory"
mkdir -p $ACTIVEMQ_INSTALL_HOME
-cd $ACTIVEMQ_INSTALL_HOME
if [ $offline = true ]
then
- cp $KYLO_SETUP_FOLDER/activemq/apache-activemq-$ACTIVEMQ_INSTALL_VERSION-bin.tar.gz .
+ cp $KYLO_SETUP_FOLDER/activemq/apache-activemq-$ACTIVEMQ_INSTALL_VERSION-bin.tar.gz $ACTIVEMQ_INSTALL_HOME
+ cd $ACTIVEMQ_INSTALL_HOME
else
echo "Download activemq and install"
+ cd $ACTIVEMQ_INSTALL_HOME
curl -O https://archive.apache.org/dist/activemq/$ACTIVEMQ_INSTALL_VERSION/apache-activemq-$ACTIVEMQ_INSTALL_VERSION-bin.tar.gz
fi
+
if ! [ -f apache-activemq-$ACTIVEMQ_INSTALL_VERSION-bin.tar.gz ]
then
echo "Installation file not found.. exiting"
