From: Zeljko Boros Date: Wed, 10 Mar 2021 17:50:27 +0000 (+0100) Subject: Dodan cronojob i skripta za obavijest o isteklom certifikatu X-Git-Tag: debian/20210226+cn9u2^0 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=428306fca14f3f570b48204219215c8e1b556481;p=bacula-cn.git Dodan cronojob i skripta za obavijest o isteklom certifikatu --- 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