summaryrefslogtreecommitdiffstats
path: root/scripts/xds-server-start.sh
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-06-07 14:16:09 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-06-07 14:16:09 +0200
commit59e728d5bb9b9e386a2d9589cfb5e2c77d72d354 (patch)
tree7a0149934dc12e3409ba952717c0ac425a47e806 /scripts/xds-server-start.sh
parent17f976697a26ea2865ebf8529b0115581ea048c9 (diff)
Allow to not update xds-agent tarball on startup.
Also set debug loglevel to info
Diffstat (limited to 'scripts/xds-server-start.sh')
-rwxr-xr-xscripts/xds-server-start.sh31
1 files changed, 17 insertions, 14 deletions
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