From 615e32c3bc6d31f26d7b95aa40886eda11d7aa1e Mon Sep 17 00:00:00 2001 From: Andrzej Ressel Date: Fri, 5 Jun 2020 02:27:01 +0200 Subject: [PATCH] Add support for custom Xen Orchestra repository --- sample.xo-install.cfg | 3 +++ xo-install.sh | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sample.xo-install.cfg b/sample.xo-install.cfg index 31a64cb..dfc0d64 100644 --- a/sample.xo-install.cfg +++ b/sample.xo-install.cfg @@ -10,6 +10,9 @@ INSTALLDIR="/opt/xo" # Configuration is stored in XOUSER's home directory and by default will be overwritten with every update done by this script. Set CONFIGUPDATE to false if you don't want this to happen CONFIGUPDATE=true +# Location of Xen Orchestra repository +REPOSITORY="https://github.com/vatesfr/xen-orchestra" + # Git branch or tag (append tags/ before the tag name) where xen-orchestra sources are fetched. # Also, you can set this to "release" to use the latest tagged branch. BRANCH="master" diff --git a/xo-install.sh b/xo-install.sh index fe27b82..d86c7f2 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -27,6 +27,7 @@ PRESERVE=${PRESERVE:-"3"} XOUSER=${XOUSER:-"root"} CONFIGPATH="$(getent passwd $XOUSER | cut -d: -f6)" PLUGINS="${PLUGINS:-"none"}" +REPOSITORY="${REPOSITORY:-"https://github.com/vatesfr/xen-orchestra"}" # set variables not changeable in configfile TIME=$(date +%Y%d%m%H%M) @@ -416,8 +417,8 @@ function InstallXO { if [[ ! -d "$XO_SRC_DIR" ]]; then cmdlog "mkdir -p \"$XO_SRC_DIR\"" mkdir -p "$XO_SRC_DIR" - cmdlog "git clone https://github.com/vatesfr/xen-orchestra \"$XO_SRC_DIR\"" - git clone https://github.com/vatesfr/xen-orchestra "$XO_SRC_DIR" >>$LOGFILE 2>&1 + cmdlog "git clone \"${REPOSITORY}\" \"$XO_SRC_DIR\"" + git clone "${REPOSITORY}" "$XO_SRC_DIR" >>$LOGFILE 2>&1 else cmdlog "cd \"$XO_SRC_DIR\"" cd "$XO_SRC_DIR" >>$LOGFILE 2>&1