echo \
$"Usage: $0 <vserver-name> -- [-o options] [--bind|--rbind]
[-t <type>] [-a] [-n] [--move]
- <source> <destination>
+ [<source> [<destination>]]
<source> ... what to mount, this is relative to the host's root
<destination> ... where to mount it, this is relative to the guest's root
declare -a guests
-while true; do
+while test $# -gt 0; do
case "$1" in
(--) shift; break;;
+ (-*) break;;
(*)
_setVserverDir "$1"
guests=( "${guests[@]}" "$VSERVER_DIR" )
eval set -- "$tmp"
declare -a options
-
+fstype=""
while true; do
case "$1" in
(--help) showHelp $0 ;;
options=( "${options[@]}" "$1" )
;;
(-t|-o) options=( "${options[@]}" "$1" "$2" )
+ test "$1" != "-t" || fstype="$1"
shift
;;
(--) shift; break;;
shift
done
-case "$1" in
- (/*) ;;
- (*) panic $"vmount: the source must be an absolute path";;
+case "x$1" in
+ (x/*|x) ;;
+ (*) test "$fstype" = "nfs" || panic $"vmount: the source must be an absolute path";;
esac
rc=0
for guest in "${guests[@]}"; do
pushd "$guest/vdir" &> /dev/null
- $_VNAMESPACE -e "$guest" -- \
+ callInNamespace "$guest" \
$_SECURE_MOUNT --chroot --fstab "$guest/fstab" "${options[@]}" "$@"
test "$?" -eq 0 || rc=$?
popd &> /dev/null