Prva inačica za bullseye
[bacula-cn.git] / bacula-check-cert
index 29b6e6f..a96fa7c 100755 (executable)
@@ -3,8 +3,8 @@
 BACULACRT=/etc/bacula/bacula-fd.pem
 DAYS=$(expr 30 \* 86400)
 
-if [ ! -f $BACULACRT ]; then 
-        mailx -s "BACULA: Ne mogu otvoriti datoteku $BACULACRT!" root <<EOF
+if [ ! -r $BACULACRT ]; then 
+        mailx -s "BACULA: Ne mogu otvoriti datoteku $BACULACRT!" -a 'Content-Type: text/plain; charset="utf-8"' root <<EOF
 
                 Datoteka $BACULACRT nije dostupna ili je korisnik 'bacula' ne može otvoriti!
 
@@ -21,11 +21,19 @@ fi
 SSL=$(openssl x509 -checkend $DAYS -in $BACULACRT)
 
 if [ $? -eq 1 ];  then
-        mailx -s "BACULA: Certifikat za Baculu zahtijeva PROVJERU!" root <<EOF
+        mailx -s "BACULA: Provjerite certifikat za Baculu!" -a 'Content-Type: text/plain; charset="utf-8"' root <<EOF
         
         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)
+
+       Datum kada ističe certifikat možete vidjeti s naredbom:
+
+       openssl x509 -enddate -noout -in /etc/bacula/bacula-fd.pem
         
-        Certifikat obnovite po uputama na https://sysportal.carnet.hr/node/834
+        Ukoliko je certifikat istekao ili je pred istekom, obnovite ga uz pomoć skripte renew_cert.sh, koja se nalazi unutar ovog paketa.
+
+       Certifikat pošaljite na adresu sysbackup@carnet.hr i ne zaboravite restartati servis bacula-fd.
+
+       Više informacija možete pronaći na adresi https://sysportal.carnet.hr/node/834 .
         
 EOF
         exit 1