X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fvmount;h=c9dde07c4c4bfe97407f82703c7b9e8b3fc3de7f;hb=c0ea11d48d9bf2c27ab89c41012a00b206b6bbf0;hp=0afe144739849ad5cb76286846e39056defdaf4b;hpb=fa0c3b8e1196700ca7ff9f9adcb43df3df7f40cb;p=util-vserver.git diff --git a/scripts/vmount b/scripts/vmount index 0afe144..c9dde07 100755 --- a/scripts/vmount +++ b/scripts/vmount @@ -30,7 +30,7 @@ function showHelp() echo \ $"Usage: $0 -- [-o options] [--bind|--rbind] [-t ] [-a] [-n] [--move] - + [ []] ... what to mount, this is relative to the host's root ... where to mount it, this is relative to the guest's root @@ -53,9 +53,10 @@ the GNU General Public License. This program has absolutely no warranty." declare -a guests -while true; do +while test $# -gt 0; do case "$1" in (--) shift; break;; + (-*) break;; (*) _setVserverDir "$1" guests=( "${guests[@]}" "$VSERVER_DIR" ) @@ -68,7 +69,7 @@ tmp=$(getopt -o +o:t:an --long help,version,debug,bind,rbind,move -n "$0" -- "$@ eval set -- "$tmp" declare -a options - +fstype="" while true; do case "$1" in (--help) showHelp $0 ;; @@ -78,6 +79,7 @@ while true; do options=( "${options[@]}" "$1" ) ;; (-t|-o) options=( "${options[@]}" "$1" "$2" ) + test "$1" != "-t" || fstype="$1" shift ;; (--) shift; break;; @@ -86,15 +88,15 @@ while true; do 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