fixed catifexec function to actually work, also now takes arguments that are passed...
[matthijs/upstream/backupninja.git] / handlers / sys.in
index 2c48883ce11576639a7ae7231249b59ccd840c6f..9e6343f79b8de792889b0a65ba4bbd7365a5cb11 100755 (executable)
@@ -188,10 +188,12 @@ catiffile () {
 } 
 
 catifexec () {
-   echo $HASHES >> $sysreportfile
-   echo "# $STATUS" >> $sysreportfile
-   echo $HASHES >> $sysreportfile
-   $1  >> $sysreportfile 2>&1 || info "executing of $1 failed"
+   if [ -x $1 ]; then
+      echo $HASHES >> $sysreportfile
+      echo "# $STATUS" >> $sysreportfile
+      echo $HASHES >> $sysreportfile
+      $*  >> $sysreportfile 2>&1 || info "executing of $1 failed"
+   fi
 }