Fixed indentation
[matthijs/upstream/backupninja.git] / src / backupninja.in
index a991f58808fa8cbfd5b5ed523c2257873fbb544c..34021b56ec4350e811e73762e127bc5fa9fc2a98 100755 (executable)
@@ -335,8 +335,9 @@ function process_action() {
    _errors=`cat $bufferfile | grep "^Error: " | wc -l`
    _fatals=`cat $bufferfile | grep "^Fatal: " | wc -l`
    _halts=`cat $bufferfile | grep "^Halt: " | wc -l`
    _errors=`cat $bufferfile | grep "^Error: " | wc -l`
    _fatals=`cat $bufferfile | grep "^Fatal: " | wc -l`
    _halts=`cat $bufferfile | grep "^Halt: " | wc -l`
+   _infos=`cat $bufferfile | grep "^Info: " | wc -l`
 
 
-   ret=`grep "\(^Warning: \|^Error: \|^Fatal: \|Halt: \)" $bufferfile`
+   ret=`grep "\(^Info: \|^Warning: \|^Error: \|^Fatal: \|Halt: \)" $bufferfile`
    rm $bufferfile
    if [ $_halts != 0 ]; then
       msg "*halt* -- $file"
    rm $bufferfile
    if [ $_halts != 0 ]; then
       msg "*halt* -- $file"
@@ -356,6 +357,9 @@ function process_action() {
       warning "<<<< finished action $file: WARNING"
    else
       msg "success -- $file"
       warning "<<<< finished action $file: WARNING"
    else
       msg "success -- $file"
+      if [ $_infos != 0 -a "$reportinfo" == "yes" ]; then
+         errormsg="$errormsg\n== infos from $file ==\n\n$ret\n"
+      fi
       info "<<<< finished action $file: SUCCESS"
    fi
 
       info "<<<< finished action $file: SUCCESS"
    fi
 
@@ -456,6 +460,7 @@ getconf reportemail
 getconf reporthost
 getconf reportspace
 getconf reportsuccess yes
 getconf reporthost
 getconf reportspace
 getconf reportsuccess yes
+getconf reportinfo no
 getconf reportuser
 getconf reportwarning yes
 getconf loglevel 3
 getconf reportuser
 getconf reportwarning yes
 getconf loglevel 3
@@ -564,11 +569,11 @@ if [ $doit == 1 ]; then
       if [ "$reportspace" == "yes" ]; then
          previous=""
          for i in $(ls "$configdirectory"); do
       if [ "$reportspace" == "yes" ]; then
          previous=""
          for i in $(ls "$configdirectory"); do
-         backuploc=$(grep ^directory "$configdirectory"/"$i" | @AWK@ '{print $3}')
-         if [ "$backuploc" != "$previous" -a -n "$backuploc" ]; then
-            df -h "$backuploc"
-            previous="$backuploc"
-         fi
+            backuploc=$(grep ^directory "$configdirectory"/"$i" | @AWK@ '{print $3}')
+            if [ "$backuploc" != "$previous" -a -n "$backuploc" ]; then
+               df -h "$backuploc"
+               previous="$backuploc"
+            fi
          done
       fi
    } | mail -s "backupninja: $hostname $subject" $reportemail
          done
       fi
    } | mail -s "backupninja: $hostname $subject" $reportemail