-# see if we can login
-debug "ssh -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1'"
-if [ ! $test ]; then
- result=`ssh -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1' 2>&1`
+### vservers stuff ###
+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'
+fi
+
+### see if we can login ###
+
+if [ "$testconnect" == "yes" ]; then
+ debug "ssh $sshoptions -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1'"
+ if [ ! $test ]; then
+ result=`ssh $sshoptions -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1'`