From d970ccb156517c9d51c494c16945c15470fa576f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 18 Mar 2020 15:06:54 +0100 Subject: additionalWatchHook() new --- shutdownasap.conf.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'shutdownasap.conf.in') diff --git a/shutdownasap.conf.in b/shutdownasap.conf.in index cfd9f91..7558407 100755 --- a/shutdownasap.conf.in +++ b/shutdownasap.conf.in @@ -30,6 +30,20 @@ beforeWatchHook() { true } +# hook to execute if we believe, the system should come down +# If this hook returns with 0, everything is ok - if it returns with 1, +# we should keep waiting for shutdown (and ask this hook again). +additionalWatchHook() { + if command -v check-if-bareos-backup-is-running; then + if ! sudo check-if-bareos-backup-is-running; then + return 1 + else + return 0 + fi + fi + return 0 +} + # hook to execute before shutting down beforeShutDownHook() { if command -v doalogwatch >/dev/null; then -- cgit v1.2.3-54-g00ecf