X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fvsomething;h=a8680e7b26f823c53d7f6e7e8f6ecf082227e999;hb=95e2774070e989fe9cf9f48dae5fa054e55e2a3e;hp=1826a20d6cf502c229962818910c7369f79f2101;hpb=3f3cf95f755f3ef1c31ad8e38153deb4ee214c66;p=util-vserver.git diff --git a/scripts/vsomething b/scripts/vsomething index 1826a20..a8680e7 100755 --- a/scripts/vsomething +++ b/scripts/vsomething @@ -1,5 +1,5 @@ #! /bin/bash -# $Id: vsomething,v 1.3 2005/04/24 20:30:55 ensc Exp $ +# $Id: vsomething 2599 2007-08-26 21:30:50Z dhozac $ # Copyright (C) 2005 Enrico Scholz # @@ -23,6 +23,7 @@ test -e "$UTIL_VSERVER_VARS" || { } . "$UTIL_VSERVER_VARS" . "$_LIB_FUNCTIONS" +. "$__PKGLIBDIR/vserver.functions" function showHelp() @@ -105,8 +106,15 @@ for i in "${vservers[@]}"; do if pkgmgmt.isInternal "$i"; then $_VSERVER "$i" exec "$cmd" "$@" else - callInNamespace "$i" \ - "$_VNAMESPACE" --new -- "$VSOMETHING_WORKER" "$i" "$@" + _setVserverDir "$i" + # subshell so we don't have to clean up + ( _generateChbindOptions "$VSERVER_DIR" + $_VSERVER "$i" status &> /dev/null || \ + CHBIND_CMD=() + callInNamespace "$i" \ + "$_VNAMESPACE" --new -- \ + "${CHBIND_CMD[@]}" \ + "$VSOMETHING_WORKER" "$i" "$@" ) fi else "$cmd" "$i" "$@"