move date variable to the beginning so that logfile and install directory date match

This commit is contained in:
ronivay
2020-05-30 19:11:22 +03:00
parent bed522219e
commit e634929e7d

View File

@@ -22,12 +22,15 @@ PORT=${PORT:-80}
INSTALLDIR=${INSTALLDIR:-"/opt/xo"}
BRANCH=${BRANCH:-"master"}
LOGPATH="${LOGPATH:-$(dirname $0)/logs}"
LOGFILE="${LOGPATH}/xo-install.log-$(date +%Y%d%m%H%M)"
AUTOUPDATE=${AUTOUPDATE:-"true"}
PRESERVE=${PRESERVE:-"3"}
XOUSER=${XOUSER:-"root"}
CONFIGPATH="$(getent passwd $XOUSER | cut -d: -f6)"
# set variables not changeable in configfile
TIME=$(date +%Y%d%m%H%M)
LOGFILE="${LOGPATH}/xo-install.log-$TIME"
# Set path where new source is cloned/pulled
XO_SRC_DIR="$INSTALLDIR/xo-src/xen-orchestra"
@@ -353,8 +356,6 @@ function InstallXO {
trap ErrorHandling ERR INT
TIME=$(date +%Y%d%m%H%M)
# Create user if doesn't exist (if defined)
if [[ "$XOUSER" != "root" ]]; then