From 428306fca14f3f570b48204219215c8e1b556481 Mon Sep 17 00:00:00 2001 From: Zeljko Boros Date: Wed, 10 Mar 2021 18:50:27 +0100 Subject: [PATCH] Dodan cronojob i skripta za obavijest o isteklom certifikatu --- bacula-check-cert | 17 +++++++++++++++++ bacula-cn | 1 + 2 files changed, 18 insertions(+) create mode 100755 bacula-check-cert create mode 100644 bacula-cn diff --git a/bacula-check-cert b/bacula-check-cert new file mode 100755 index 0000000..9ea91ef --- /dev/null +++ b/bacula-check-cert @@ -0,0 +1,17 @@ +#!/bin/bash + +BACULACRT=/etc/bacula/bacula-fd.pem.old + +test -f $BACULACRT || echo "Ne mogu otvoriti datoteku $BACULACRT!" + +DAYS=$(expr 30 \* 86400) + +SSL=$(openssl x509 -checkend $DAYS -in $BACULACRT) + +if [ $? -eq 1 ]; then + echo -n "Valjanost certifikata za Baculu je istekla ili će isteći na dan: " + date --date="$(openssl x509 -in $BACULACRT -noout -enddate | cut -d= -f 2)" --iso-8601 + echo ""; echo "Certifikat obnovite po uputama na https://sysportal.carnet.hr/node/834" +fi + +exit 0 diff --git a/bacula-cn b/bacula-cn new file mode 100644 index 0000000..e03b4a1 --- /dev/null +++ b/bacula-cn @@ -0,0 +1 @@ +15 8 * * * bacula /usr/bin/bacula-check-cert 2>&1 | mail -s "Valjanost certifikata za Baculu JE ISTEKLA!" root -- 1.7.10.4