From df7d26e4181a16484f27adcdcd67b15f489b662a Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 7 Jun 2016 09:27:37 +0200 Subject: [PATCH] Fix for copy VOLUMES by @ehlers --- gns3server/modules/docker/resources/init.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gns3server/modules/docker/resources/init.sh b/gns3server/modules/docker/resources/init.sh index 9ce22515..43f31685 100755 --- a/gns3server/modules/docker/resources/init.sh +++ b/gns3server/modules/docker/resources/init.sh @@ -29,15 +29,10 @@ if [ ! -d /tmp/gns3/bin ]; then fi # Restore file permission and mount volumes -for i in $(echo "$GNS3_VOLUMES" | tr ":" "\n") +echo "$GNS3_VOLUMES" | tr ":" "\n" | while read i do # Copy original files if destination is empty (first start) - if ! [ "$(ls -A /gns3volumes$i)" ]; then - for file in $(ls -A "$i") - do - cp -a "$i/$file" "/gns3volumes$i/$file" - done - fi + [ "$(ls -A "/gns3volumes$i")" ] || cp -a "$i/." "/gns3volumes$i" mount --bind "/gns3volumes$i" "$i" if [ -f "$i/.gns3_perms" ]