Save an restore docker permission

Fix #550
This commit is contained in:
Julien Duponchelle committed 2016-06-01 18:16:56 +02:00
1 parent ae687346f1
commit 435dc82873
3 files changed
+17 -2

No files matched your search

@@ -28,6 +28,21 @@ if [ ! -d /tmp/gns3/bin ]; then
/gns3/bin/busybox --install -s /tmp/gns3/bin
fi
# Restore file permission
for i in $(echo "$GNS3_VOLUMES" | tr ":" "\n")
do
cd $i
if [ -f .gns3_perms ]
then
while IFS=: read PERMS OWNER GROUP FILE
do
chmod "$PERMS" "$FILE"
chown "${OWNER}:${GROUP}" "$FILE"
done < .gns3_perms
fi
done
# /etc/hosts
[ -s /etc/hosts ] || cat > /etc/hosts << __EOF__
127.0.1.1 $HOSTNAME