From 0805255ee01103c500f2aae8845850b3dae6a0b6 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Fri, 26 May 2017 16:03:24 +0200 Subject: Add doc to create & start XDS AGL docker container. Signed-off-by: Sebastien Douheret --- scripts/xds-start-server.sh | 2 +- scripts/xds-stop-server.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 scripts/xds-stop-server.sh (limited to 'scripts') diff --git a/scripts/xds-start-server.sh b/scripts/xds-start-server.sh index 9a6ff05..066029a 100755 --- a/scripts/xds-start-server.sh +++ b/scripts/xds-start-server.sh @@ -14,7 +14,7 @@ [[ -f $BINDIR/xds-server ]] || { echo "Cannot find xds-server in BINDIR !"; exit 1; } # Create config.json file when needed -if [ -f "${XDS_CONFFILE}" ]; then +if [ ! -f "${XDS_CONFFILE}" ]; then mv ${XDS_CONFFILE} ${XDS_CONFFILE}.old [ ! -f "$XDS_WWWDIR/index.html" ] && XDS_WWWDIR=$BINDIR/www-xds-server [ ! -f "$XDS_WWWDIR/index.html" ] && XDS_WWWDIR=/var/www/xds-server diff --git a/scripts/xds-stop-server.sh b/scripts/xds-stop-server.sh new file mode 100644 index 0000000..8a6bf5e --- /dev/null +++ b/scripts/xds-stop-server.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Stop it gracefully +pkill -INT xds-server +sleep 1 + +# Seems no stopped, nasty kill +nbProc=$(ps -ef |grep xds-server |grep -v grep |wc -l) +if [ "$nbProc" != "0" ]; then + pkill -KILL xds-server +fi + +nbProc=$(ps -ef |grep syncthing |grep -v grep |wc -l) +if [ "$nbProc" != "0" ]; then + pkill -KILL syncthing + pkill -KILL syncthing-inotify +fi + -- cgit 1.2.3-korg