X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fvserver-wrapper;h=b9c9465ac517bdcd491acc7787be14b7f0e9fbc1;hb=b43c2cf74495f7efd66fc318bb575eb2b4db110d;hp=ccbd2e134813f488b19b2f924ea2956170b8bcab;hpb=9c78378bebc1a9f3d400f422df8ede9efea57dea;p=util-vserver.git diff --git a/scripts/vserver-wrapper b/scripts/vserver-wrapper index ccbd2e1..b9c9465 100755 --- a/scripts/vserver-wrapper +++ b/scripts/vserver-wrapper @@ -29,16 +29,27 @@ test -n "$MARK" || MARK=default if test -e /etc/init.d/functions; then . /etc/init.d/functions + _beginResult() { echo -n "$@ ..."; } + _postResult() { echo; } lockfile=/var/lock/subsys/$LOCKFILE +elif test -e /etc/gentoo-release; then + . /sbin/functions.sh + _beginResult() { ebegin "$@"; } + _postResult() { :; } + success() { eend 0; } + passed() { eend 0; } + failure() { eend 1; } + lockfile=/var/lock/vservers/$LOCKFILE else + _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 @@ -46,15 +57,15 @@ function _tellResult() (2) passed; rc=0;; (*) failure;; esac - echo + _postResult return $rc } function start() { - echo -n $"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 @@ -62,9 +73,9 @@ function start() function stop() { - echo -n $"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