aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-06-24 15:49:06 +0000
committerintrigeri <intrigeri@boum.org>2008-06-24 15:49:06 +0000
commit6c628e78f4f64680b5cec6b8062fe7e0f654043b (patch)
treeffd35eace087e31d85eb743ce46c76b2e5896db0 /lib
parentad8db347dcc0114c6d32207ecd2f00abd5d81986 (diff)
downloadbackupninja-6c628e78f4f64680b5cec6b8062fe7e0f654043b.tar.gz
backupninja-6c628e78f4f64680b5cec6b8062fe7e0f654043b.tar.bz2
lib/vserver: added vservers_running function, use it in sys handler (to ease future fix for Trac#45)
Diffstat (limited to 'lib')
-rw-r--r--lib/vserver.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/vserver.in b/lib/vserver.in
index f65bd4c..153a9b0 100644
--- a/lib/vserver.in
+++ b/lib/vserver.in
@@ -95,6 +95,20 @@ vservers_exist() {
}
##
+## If all the arguments are running vservers names, returns 0.
+## Else, returns 1. Also returns 1 if no argument is given.
+##
+vservers_running() {
+ [ $# -ge 1 ] || return 1
+ local args="$1"
+ local vserver
+ for vserver in $args ; do
+ $VSERVERINFO -q $vserver RUNNING || return 1
+ done
+ return 0
+}
+
+##
## If the argument is the name of a vserver selected by the current helper,
## echoes 'on' and returns 0.
## Else, echoes 'off' and returns 1.