From 70f773b62045c2190cdc7e69d17f5de42647b5c0 Mon Sep 17 00:00:00 2001 From: Benedikt Boehm Date: Wed, 20 Dec 2006 13:39:58 +0000 Subject: [PATCH] cosmetic fixes for vserver-wrapper git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2432 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- scripts/vserver-wrapper | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/vserver-wrapper b/scripts/vserver-wrapper index 2e4df9f..b9c9465 100755 --- a/scripts/vserver-wrapper +++ b/scripts/vserver-wrapper @@ -29,24 +29,27 @@ test -n "$MARK" || MARK=default if test -e /etc/init.d/functions; then . /etc/init.d/functions - _beginResult() { echo -n "$@"; } + _beginResult() { echo -n "$@ ..."; } + _postResult() { echo; } lockfile=/var/lock/subsys/$LOCKFILE elif test -e /etc/gentoo-release; then . /sbin/functions.sh _beginResult() { ebegin "$@"; } - success() { eend "$@"; } - passed() { eend "$@"; } - failure() { eend "$@"; } + _postResult() { :; } + success() { eend 0; } + passed() { eend 0; } + failure() { eend 1; } lockfile=/var/lock/vservers/$LOCKFILE else - _beginResult() { echo -n "$@"; } + _beginResult() { echo -n "$@ ..."; } + _postResult() { :; } success() { echo .; } passed() { echo .; } failure() { echo ERROR; } lockfile=/var/run/$LOCKFILE fi -function _tellResult() +function _endResult() { local rc=$1 case "$rc" in @@ -54,15 +57,15 @@ function _tellResult() (2) passed; rc=0;; (*) failure;; esac - echo + _postResult return $rc } function start() { - _beginResult $"Starting vservers of type '$MARK'..." + _beginResult $"Starting vservers of type '$MARK'" $_START_VSERVERS -m "$MARK" -j "$NUMPARALLEL" --all --start - _tellResult $? + _endResult $? local rc=$? test "$rc" -ne 0 || touch "$lockfile" return $rc @@ -70,9 +73,9 @@ function start() function stop() { - _beginResult $"Stopping vservers of type '$MARK'..." + _beginResult $"Stopping vservers of type '$MARK'" $_START_VSERVERS -m "$MARK" -j "$NUMPARALLEL" --all --stop - _tellResult $? + _endResult $? local rc=$? $_RM -f "$lockfile" return $rc -- 1.8.1.5