version fix
[bacula-cn.git] / bacula-check-cert
index e740445..3ada58c 100755 (executable)
@@ -3,13 +3,14 @@
 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!
 
                 Molimo provjerite status certifikata i po potrebi ga osvježite po uputama na adresi:
-                https://sysportal.carnet.hr/node/834
+
+               https://sysportal.carnet.hr/node/834
 
 
 EOF
@@ -20,7 +21,7 @@ fi
 SSL=$(openssl x509 -checkend $DAYS -in $BACULACRT)
 
 if [ $? -eq 1 ];  then
-        mailx -s "BACULA: Valjanost certifikata za Baculu je ISTEKLA!" root <<EOF
+        mailx -s "BACULA: Certifikat za Baculu zahtijeva PROVJERU!" -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)