From: Enrico Scholz Date: Mon, 20 Oct 2003 18:04:01 +0000 (+0000) Subject: added '--sync' and '--verbose' options X-Git-Tag: VERSION_0_10~1182 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=377f29c385709ec73636f84d2da55d28a3135f4d;p=util-vserver.git added '--sync' and '--verbose' options sync the 'stop' stage on restart fixed invocation of 'vserver-build' git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@231 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/scripts/vserver b/util-vserver/scripts/vserver index 991c111..b253e86 100755 --- a/util-vserver/scripts/vserver +++ b/util-vserver/scripts/vserver @@ -31,7 +31,8 @@ test -e "$UTIL_VSERVER_VARS" || { function showHelp() { echo \ -$"Usage: $(basename $0) [--] * +$"Usage: $(basename $0) [-s|--sync] [-v|--verbose] + [--] * is the name of a vserver. @@ -77,23 +78,30 @@ the GNU General Public License. This program has absolutely no warranty." set +e -tmp=$(getopt -o + --long help,version -n "$0" -- "$@") || exit 1 +tmp=$(getopt -o +sv --long help,version,sync,verbose -n "$0" -- "$@") || exit 1 eval set -- "$tmp" +OPTION_FORCE_SYNC= +OPTION_VERBOSE= + while true; do case "$1" in - --help) showHelp $0 ;; - --version) showVersion ;; - --) shift; break;; - *) echo $"vserver: internal error; arg=='$1'"; exit 1;; + --help) showHelp $0 ;; + --version) showVersion ;; + -v|--verbose) OPTION_VERBOSE=1; shift;; + -s|--sync) OPTION_FORCE_SYNC=1; shift;; + --) shift; break;; + *) echo $"vserver: internal error; arg=='$1'"; exit 1;; esac done -test "$2" != build || { shift; exec "$_VSERVER_BUILD" "$@"; } vserver=$1 cmd=$2 +test "$cmd" != build || { shift 2; exec "$_VSERVER_BUILD" -n "$vserver" "$@"; } + + allow_legacy= case "$vserver" in @@ -133,7 +141,7 @@ case "$2" in . $PKGLIBDIR/vserver.$cmd ;; restart) - "$0" "$1" stop + "$0" --sync "$1" stop exec "$0" "$1" start ;; condrestart)