@@ -58,6 +58,7 @@ Options:
58
58
-n, --nfs-config NFS configuration to use in /etc/exports. (default to '-alldirs -mapall=\$ (id -u):\$ (id -g)')
59
59
-s, --shared-folder,... Folder to share (default to /Users)
60
60
-m, --mount-opts NFS mount options (default to 'noacl,async')
61
+ -i, --use-ip-range Changes the nfs export ip to a range (e.g. -network 192.168.99.100 becomes -network 192.168.99)
61
62
62
63
Examples:
63
64
@@ -76,7 +77,6 @@ Examples:
76
77
$ docker-machine-nfs test --mount-opts="noacl,async,nolock,vers=3,udp,noatime,actimeo=1"
77
78
78
79
> Configure the /User folder with NFS and specific mount options.
79
-
80
80
EOF
81
81
exit 0
82
82
}
@@ -131,6 +131,7 @@ setPropDefaults()
131
131
prop_nfs_config=" -alldirs -mapall=" $( id -u) :$( id -g)
132
132
prop_mount_options=" noacl,async"
133
133
prop_force_configuration_nfs=false
134
+ prop_use_ip_range=false
134
135
}
135
136
136
137
# @info: Parses and validates the CLI arguments
@@ -164,10 +165,12 @@ parseCli()
164
165
prop_mount_options=" ${i#* =} "
165
166
;;
166
167
167
-
168
168
-f|--force)
169
169
prop_force_configuration_nfs=true
170
- shift
170
+ ;;
171
+
172
+ -i|--use-ip-range)
173
+ prop_use_ip_range=true
171
174
;;
172
175
173
176
* )
@@ -343,10 +346,15 @@ configureNFS()
343
346
# Write new exports blocks beginning
344
347
exports=" ${exports} \n${exports_begin} \n"
345
348
349
+ local machine_ip=$prop_machine_ip
350
+ if [ " $prop_use_ip_range " = true ]; then
351
+ machine_ip=" ${machine_ip% .* } "
352
+ fi
353
+
346
354
for shared_folder in " ${prop_shared_folders[@]} "
347
355
do
348
356
# Add new exports
349
- exports=" ${exports} $shared_folder $prop_machine_ip $prop_nfs_config \n"
357
+ exports=" ${exports} $shared_folder -network $machine_ip $prop_nfs_config \n"
350
358
done
351
359
352
360
# Write new exports block ending
0 commit comments