Allow the entire backup run to be halted by an action (Closes: #455836)
[matthijs/upstream/backupninja.git] / lib / vserver.in
index 1c267c6f0acaacf4a02b02a5d32e566ff8e217b7..f65bd4c37a7d7e9c2e6ce09f99a6847e2b530904 100644 (file)
@@ -33,9 +33,9 @@ init_vservers() {
    getconf vservers no
    getconf VSERVERINFO /usr/sbin/vserver-info
    getconf VSERVER /usr/sbin/vserver
-   getconf VROOTDIR `if [ -x "$VSERVERINFO" ]; then $VSERVERINFO info SYSINFO | grep '^ *vserver-Rootdir' | awk '{print $2}'; fi`
+   getconf VROOTDIR `if [ -x "$VSERVERINFO" ]; then $VSERVERINFO info SYSINFO | grep '^ *vserver-Rootdir' | @AWK@ '{print $2}'; fi`
    # canonicalize VROOTDIR
-   VROOTDIR=`readlink --canonicalize $VROOTDIR`
+   [ -z "$VROOTDIR" ] || VROOTDIR=`readlink --canonicalize $VROOTDIR`
    # init this library's global variables
    vservers_are_available=no
    found_vservers=
@@ -63,7 +63,7 @@ init_vservers() {
             "vservers enabled in $conffile, but VROOTDIR ($VROOTDIR) does not exist.";
             return
       fi
-      found_vservers=`ls $VROOTDIR | grep -E -v "lost+found|ARCHIVES" | tr "\n" " "`
+      found_vservers=`ls $VROOTDIR | grep -E -v "lost\+found|ARCHIVES" | tr "\n" " "`
       if [ -z "$found_vservers" ]; then
          `if [ "$arg" = nodialog ]; then echo warning; else echo "msgBox warning"; fi` \
             "vservers enabled in $conffile, but no vserver was found in $VROOTDIR.";