Browse Source

Allow installLabkey.sh to use second argument to override install location, useful if running more than one labkey server

Andrej Studen 2 months ago
parent
commit
5826178036
1 changed files with 14 additions and 7 deletions
  1. 14 7
      bin/installLabkey.sh

+ 14 - 7
bin/installLabkey.sh

@@ -33,7 +33,13 @@ then
 
 fi;
 
-echo "Using $LABKEY";
+TARGET=${LABKEY_DIR}
+if [ $# -gt 1 ] ; 
+then
+   TARGET=$2;
+fi;
+
+echo "Using $LABKEY; setting up in $TARGET";
 
 #full path to source
 SFW_SRC=$HOME/packages/$LABKEY.tar.gz
@@ -46,10 +52,11 @@ then
 	mkdir ${TMP_DIR};
 fi;
 
-#is there anything relevant in $LABKEY_DIR?
-if [ ! -d $LABKEY_DIR ] ; 
+#target LabkeyDir
+#is there anything relevant in $TARGET?
+if [ ! -d $TARGET ] ; 
 then
-	mkdir $LABKEY_DIR;
+	mkdir $TARGET;
 fi;
 
 #unpack to ${TMP_DIR}/$LABKEY
@@ -69,7 +76,7 @@ LABKEY_SRC_DIRS=("labkeywebapp" "modules" "pipeline-lib")
 
 for d in ${LABKEY_SRC_DIRS[@]} ; 
 do
-   mv ${TMP_LABKEY}/$d ${LABKEY_DIR}/$d;
+   mv ${TMP_LABKEY}/$d $TARGET/$d;
 done;
 
 #check if required dirs are missing and create them
@@ -77,8 +84,8 @@ LABKEY_DIRS=("files" "externalModules")
 
 for d in ${LABKEY_DIRS[@]} ; 
 do
-   if [ ! -d ${LABKEY_DIR}/$d ] ; then
-      mkdir ${LABKEY_DIR}/$d;
+   if [ ! -d $TARGET/$d ] ; then
+      mkdir $TARGET/$d;
    fi;
 done;