From 59e728d5bb9b9e386a2d9589cfb5e2c77d72d354 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Wed, 7 Jun 2017 14:16:09 +0200 Subject: Allow to not update xds-agent tarball on startup. Also set debug loglevel to info --- scripts/xds-server-start.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/xds-server-start.sh b/scripts/xds-server-start.sh index 8814eb8..13a4268 100755 --- a/scripts/xds-server-start.sh +++ b/scripts/xds-server-start.sh @@ -6,10 +6,11 @@ [ -z "$XDS_SHAREDIR" ] && XDS_SHAREDIR=$HOME/.xds/share [ -z "$ST_CONFDIR" ] && ST_CONFDIR=$HOME/.xds/syncthing-config [ -z "$XDS_WWWDIR" ] && XDS_WWWDIR=webapp/dist -[ -z "$LOGLEVEL" ] && LOGLEVEL=warn +[ -z "$LOGLEVEL" ] && LOGLEVEL=info [ -z "$LOGDIR" ] && LOGDIR=/tmp/xds-server/logs [ -z "$PORT_GUI" ] && PORT_GUI=8384 [ -z "$API_KEY" ] && API_KEY="1234abcezam" +[ -z "$UPDATE_XDS_TARBALL" ] && UPDATE_XDS_TARBALL=0 [[ -f $BINDIR/xds-server ]] || { echo "Cannot find xds-server in BINDIR !"; exit 1; } @@ -43,21 +44,23 @@ mkdir -p ${LOGDIR} LOG_XDS=${LOGDIR}/xds-server.log # Download xds-agent tarball -SCRIPT_GET_XDS_TARBALL=$BINDIR/xds-utils/get-xds-agent.sh -if [ ! -f ${SCRIPT_GET_XDS_TARBALL} ]; then - SCRIPT_GET_XDS_TARBALL=$(dirname $0)/xds-utils/get-xds-agent.sh -fi -if [ -f ${SCRIPT_GET_XDS_TARBALL} ]; then - TARBALLDIR=${XDS_WWWDIR}/assets/xds-agent-tarballs - [ ! -d "$TARBALLDIR" ] && TARBALLDIR=$BINDIR/www-xds-server/assets/xds-agent-tarballs - [ ! -d "$TARBALLDIR" ] && TARBALLDIR=$(grep webAppDir ~/.xds/config.json|cut -d '"' -f 4)/assets/xds-agent-tarballs - if [ -d "$TARBALLDIR" ]; then - DEST_DIR=$TARBALLDIR $SCRIPT_GET_XDS_TARBALL +if [ "${UPDATE_XDS_TARBALL}" = 1 ]; then + SCRIPT_GET_XDS_TARBALL=$BINDIR/xds-utils/get-xds-agent.sh + if [ ! -f ${SCRIPT_GET_XDS_TARBALL} ]; then + SCRIPT_GET_XDS_TARBALL=$(dirname $0)/xds-utils/get-xds-agent.sh + fi + if [ -f ${SCRIPT_GET_XDS_TARBALL} ]; then + TARBALLDIR=${XDS_WWWDIR}/assets/xds-agent-tarballs + [ ! -d "$TARBALLDIR" ] && TARBALLDIR=$BINDIR/www-xds-server/assets/xds-agent-tarballs + [ ! -d "$TARBALLDIR" ] && TARBALLDIR=$(grep webAppDir ~/.xds/config.json|cut -d '"' -f 4)/assets/xds-agent-tarballs + if [ -d "$TARBALLDIR" ]; then + DEST_DIR=$TARBALLDIR $SCRIPT_GET_XDS_TARBALL + else + echo "WARNING: cannot download / update xds-agent tarballs (DESTDIR error)" + fi else - echo "WARNING: cannot download / update xds-agent tarballs (DESTDIR error)" + echo "WARNING: cannot download / update xds-agent tarballs" fi -else - echo "WARNING: cannot download / update xds-agent tarballs" fi -- cgit 1.2.3-korg