From e634929e7da4f17c59371c1923d0a3fff69fd44b Mon Sep 17 00:00:00 2001 From: ronivay Date: Sat, 30 May 2020 19:11:22 +0300 Subject: [PATCH] move date variable to the beginning so that logfile and install directory date match --- xo-install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xo-install.sh b/xo-install.sh index a94893f..b72444b 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -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