diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-09-13 15:42:09 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-09-13 17:22:13 +0200 |
commit | 5756bd350d585660cce53a28dc66bfcf162ecca1 (patch) | |
tree | cbb0c3a013c70fd48365effe90b5bd95e03e4c44 /scripts/xds-docker-create-container.sh | |
parent | 6849b490ccfe2f5ed2bb577758edf30445691378 (diff) |
Set install dir to /opt/AGL and move conf to $HOME/.xds-server
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'scripts/xds-docker-create-container.sh')
-rwxr-xr-x | scripts/xds-docker-create-container.sh | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/xds-docker-create-container.sh b/scripts/xds-docker-create-container.sh index d041a22..52dfda3 100755 --- a/scripts/xds-docker-create-container.sh +++ b/scripts/xds-docker-create-container.sh @@ -63,15 +63,14 @@ done [ "$ID" = "" ] && ID=0 -docker ps -a |grep "$IMAGE" > /dev/null -[ "$?" = "0" ] && { echo "Image name already exist ! (use -h option to read help)"; exit 1; } - - USER=$(id -un) echo "Using instance ID #$ID (user $(id -un))" NAME=agl-xds-$(hostname|cut -f1 -d'.')-$ID-$USER +docker ps -a |grep "$NAME" > /dev/null +[ "$?" = "0" ] && { echo "Image name already exist ! (use -h option to read help)"; exit 1; } + MIRRORDIR=$HOME/ssd/localmirror_$ID XDTDIR=$HOME/ssd/xdt_$ID SHAREDDIR=$HOME/$DOCKER_USER/docker/share @@ -100,11 +99,11 @@ if [ "$?" != "0" ]; then fi if ($FORCE); then - echo "Stoping xds-server..." - docker exec --user $DOCKER_USER ${NAME} bash -c "/usr/local/bin/xds-server-stop.sh" || exit 1 + echo "Stopping xds-server..." + docker exec -t ${NAME} bash -c "systemctl stop xds-server" || exit 1 sleep 1 echo "Starting xds-server..." - docker exec --user $DOCKER_USER ${NAME} bash -c "nohup /usr/local/bin/xds-server-start.sh" || exit 1 + docker exec -t ${NAME} bash -c "systemctl start xds-server" || exit 1 fi echo "Copying your identity to container $NAME" @@ -115,7 +114,7 @@ max=30 count=0 while [ $res -ne 0 ] && [ $count -le $max ]; do sleep 1 - docker exec ${NAME} bash -c "systemctl status ssh" 2>/dev/null 1>&2 + docker exec ${NAME} bash -c "systemctl status ssh" 2>/dev/null 1>&2 res=$? echo -n "." count=$(expr $count + 1); |