aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'handlers')
-rw-r--r--handlers/dup39
1 files changed, 15 insertions, 24 deletions
diff --git a/handlers/dup b/handlers/dup
index ac7e329..d32fcf2 100644
--- a/handlers/dup
+++ b/handlers/dup
@@ -34,29 +34,20 @@ destdir=${destdir%/}
[ "$include" != "" ] || fatal "No source includes specified"
### vservers stuff ###
-
-# See if vservers are configured.
-# If so, check that the ones listed in $vsnames do exist.
-if [ "$vservers" == "yes" ]; then
- [ -d "$VROOTDIR" ] || fatal "vservers enabled, but $VROOTDIR does not exist!"
- if [ "$vsnames" == "all" ]; then
- vsnames=""
- for vserver in `ls $VROOTDIR | grep -E -v "lost+found|ARCHIVES"`; do
- vsnames="$vserver $vsnames"
- done
- else
- for vserver in $vsnames; do
- [ -d "$VROOTDIR/$vserver" ] || fatal "vserver '$vserver' does not exist."
- done
- fi
- if [ -n "$vsnames" ]; then
- if [ -n "$vsinclude" ]; then
- info "Using vservers '$vsnames'"
- usevserver=1
- fi
- else
- [ -z "$vsinclude" ] || warning 'vsnames is empty, vsinclude configuration lines will be ignored'
- fi
+local usevserver=no
+# If vservers are configured, check that the ones listed in $vsnames do exist.
+if [ $vservers_are_available = yes ]; then
+ if [ "$vsnames" = all ]; then
+ vsnames="$found_vservers"
+ else
+ if ! vservers_exist "$vsnames" ; then
+ fatal "At least one of the vservers listed in vsnames ($vsnames) does not exist."
+ fi
+ fi
+ if [ -n "$vsinclude" ]; then
+ info "Using vservers '$vsnames'"
+ usevserver=yes
+ fi
else
[ -z "$vsinclude" ] || warning 'vservers support disabled in backupninja.conf, vsincludes configuration lines will be ignored'
[ -z "$vsnames" ] || warning 'vservers support disabled in backupninja.conf, vsnames configuration line will be ignored'
@@ -135,7 +126,7 @@ for i in "$include"; do
done
# vsincludes
-if [ $usevserver ]; then
+if [ $usevserver = yes ]; then
for vserver in $vsnames; do
for vi in "$vsinclude"; do
str="${vi//__star__/*}"