Dodan cronojob i skripta za obavijest o isteklom certifikatu debian/20210226+cn9u2
authorZeljko Boros <Zeljko.Boros@carnet.hr>
Wed, 10 Mar 2021 17:50:27 +0000 (18:50 +0100)
committerZeljko Boros <Zeljko.Boros@carnet.hr>
Wed, 10 Mar 2021 17:50:27 +0000 (18:50 +0100)
bacula-check-cert [new file with mode: 0755]
bacula-cn [new file with mode: 0644]

diff --git a/bacula-check-cert b/bacula-check-cert
new file mode 100755 (executable)
index 0000000..9ea91ef
--- /dev/null
@@ -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 (file)
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