exec with-lock-ex $lock_mode "$lockfile" "$0" "$mode" "$@"
}
+do-report-log () {
+ # implicitly uses $outcome, $reported etc. - see maybe-report
+ echo "$outcome" >"$attempt"/reported
+}
+
maybe-report () {
local outcome=$1
if [ "x$outcome" = "x$reported" ]; then return; fi
if [ x"$outcome" = x"ok" ] && [ x"$reported" = x ]; then
- echo ok >"$attempt/reported"
+ do-report-log
return
fi
END
/usr/sbin/sendmail -odb -oem -oee -t <"$email"
- echo "$outcome" >"$attempt"/reported
+ do-report-log
}
mode_report () {