X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fchcontext;h=60df5fe60e762529a576413e9e7082e071afc753;hb=1e81831ccede87704c368aafaee3dbd72a18b4ad;hp=7ffbd45abb1b123a35a00c839f934ad435af10ab;hpb=8fc154de56657cce880d584fbc7c3619a04b5651;p=util-vserver.git diff --git a/scripts/chcontext b/scripts/chcontext index 7ffbd45..60df5fe 100755 --- a/scripts/chcontext +++ b/scripts/chcontext @@ -27,7 +27,7 @@ test -e "$UTIL_VSERVER_VARS" || { function showHelp() { echo \ -$"Usage: /usr/sbin/chcontext [--cap [!]] [--secure] [--xid ] [--disconnect] +$"Usage: $1 [--cap [!]] [--secure] [--xid ] [--disconnect] [--domainname ] [--hostname ] [--flag +] [--silent] [--] command arguments ... @@ -84,7 +84,7 @@ By default, a new/unused context is allocated Do not print the allocated context number. Report bugs to <$PACKAGE_BUGREPORT>." - exit $1 + exit $2 } function showVersion() @@ -114,8 +114,8 @@ OPT_INITPID= while true; do case "$1" in - --help) showHelp $0 ;; - --version) showVersion ;; + --help) showHelp $0 0;; + --version) showVersion 0;; --cap) OPT_CAPS=( "${OPT_CAPS[@]}" "$2" ); shift;; --ctx|--xid) OPT_CTX=$2; shift;; --disconnect) OPT_DISCONNECT=1;; @@ -134,7 +134,8 @@ while true; do shift done -create_cmd=( $_VCONTEXT --create --silentexist +create_cmd=( ${OPT_CTX:+$_VTAG --create --tag "$OPT_CTX" --silentexist --silent --} + $_VCONTEXT --create --silentexist ${OPT_SILENT:+--silent} ${OPT_CTX:+--xid "$OPT_CTX"} ) @@ -172,5 +173,6 @@ else rc=254 fi -test "$rc" -ne 254 || exec "${migrate_cmd[@]}" --xid "$OPT_CTX" --migrate -- "$@" +test "$rc" -ne 254 || exec "$_VTAG" --migrate --tag "$OPT_CTX" --silent -- \ + "${migrate_cmd[@]}" --xid "$OPT_CTX" --migrate -- "$@" exit $rc