From 33146c6701c4c06fa8fe77ed76c8a987cf4e015f Mon Sep 17 00:00:00 2001 From: Mathieu Rochette Date: Tue, 3 Jul 2018 15:39:40 +0200 Subject: [PATCH] fix exporting multiple folders with the actual code, `docker run -d --name nfs --privileged cpuguy83/nfs-server a b c` generates: > a b c *(rw,sync,no_subtree_check,fsid=0,no_root_squash) this fix it so that it generates : > a *(rw,sync,no_subtree_check,fsid=0,no_root_squash) > b *(rw,sync,no_subtree_check,fsid=0,no_root_squash) > c *(rw,sync,no_subtree_check,fsid=0,no_root_squash) --- nfs_setup.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nfs_setup.sh b/nfs_setup.sh index d6c4231..d9f0115 100755 --- a/nfs_setup.sh +++ b/nfs_setup.sh @@ -2,11 +2,9 @@ set -e -mounts="${@}" - echo "#NFS Exports" > /etc/exports -for mnt in "${mounts[@]}"; do +for mnt in "$@"; do src=$(echo $mnt | awk -F':' '{ print $1 }') mkdir -p $src echo "$src *(rw,sync,no_subtree_check,fsid=0,no_root_squash)" >> /etc/exports