Skip to content

Commit f8649b6

Browse files
committed
Merge pull request #3 from AOEpeople/VariableImprovements
Variable improvements
2 parents 4378d55 + 857c358 commit f8649b6

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

install.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,33 @@ if [[ -n ${SKIPIMPORTFROMSYSTEMSTORAGE} ]] && ${SKIPIMPORTFROMSYSTEMSTORAGE} ;
7676
echo "Skipping import system storage backup because parameter was set"
7777
else
7878

79-
if [ ! -f "${RELEASEFOLDER}/Configuration/mastersystem.txt" ] ; then echo "Could not find mastersystem.txt"; exit 1; fi
80-
MASTER_SYSTEM=`cat ${RELEASEFOLDER}/Configuration/mastersystem.txt`
81-
if [ -z "${MASTER_SYSTEM}" ] ; then echo "Error reading master system"; exit 1; fi
79+
if [ -z "${MASTER_SYSTEM}" ] ; then
80+
if [ ! -f "${RELEASEFOLDER}/Configuration/mastersystem.txt" ] ; then echo "Could not find mastersystem.txt"; exit 1; fi
81+
MASTER_SYSTEM=`cat ${RELEASEFOLDER}/Configuration/mastersystem.txt`
82+
if [ -z "${MASTER_SYSTEM}" ] ; then echo "Error reading master system"; exit 1; fi
83+
fi
8284

8385
if [ "${MASTER_SYSTEM}" == "${ENVIRONMENT}" ] ; then
8486
echo "Current environment is the master environment. Skipping import."
8587
else
8688
echo "Current environment is not the master environment. Importing system storage..."
8789

88-
if [ ! -f "${RELEASEFOLDER}/Configuration/project.txt" ] ; then echo "Could not find project.txt"; exit 1; fi
89-
PROJECT=`cat ${RELEASEFOLDER}/Configuration/project.txt`
90-
if [ -z "${PROJECT}" ] ; then echo "Error reading project name"; exit 1; fi
90+
if [ -z "${PROJECT}" ] ; then
91+
if [ ! -f "${RELEASEFOLDER}/Configuration/project.txt" ] ; then echo "Could not find project.txt"; exit 1; fi
92+
PROJECT=`cat ${RELEASEFOLDER}/Configuration/project.txt`
93+
if [ -z "${PROJECT}" ] ; then echo "Error reading project name"; exit 1; fi
94+
fi
9195

9296
# Apply db settings
9397
cd "${RELEASEFOLDER}/htdocs" || { echo "Error while switching to htdocs directory" ; exit 1; }
9498
../tools/apply.php "${ENVIRONMENT}" ../Configuration/settings.csv --groups db || { echo "Error while applying db settings" ; exit 1; }
9599

100+
if [ -z "${SYSTEM_STORAGE_ROOT_PATH}" ] ; then
101+
SYSTEM_STORAGE_ROOT_PATH="/home/systemstorage/systemstorage/${PROJECT}/backup/${MASTER_SYSTEM}"
102+
fi
103+
96104
# Import systemstorage
97-
../tools/systemstorage_import.sh -p "${RELEASEFOLDER}/htdocs/" -s "/home/systemstorage/systemstorage/${PROJECT}/backup/${MASTER_SYSTEM}" || { echo "Error while importing systemstorage"; exit 1; }
105+
../tools/systemstorage_import.sh -p "${RELEASEFOLDER}/htdocs/" -s "${SYSTEM_STORAGE_ROOT_PATH}" || { echo "Error while importing systemstorage"; exit 1; }
98106
fi
99107

100108
fi

0 commit comments

Comments
 (0)