bin/check-key-expiry
branchrsync
changeset 40 5f159c41e8a3
parent 39 c2e97355a239
child 41 40df28fd3562
equal deleted inserted replaced
39:c2e97355a239 40:5f159c41e8a3
     1 #!/bin/bash
       
     2 
       
     3 NOTIFY='edv@schlittermann.de'
       
     4 WARNTIME=$(expr 30 \* 24 \* 60 \* 60) # seconds
       
     5 EXPIRY=$(date -d $(LC_ALL= LANG= gpg -k --with-colons apt.schlittermann.de|grep '^pub'|cut -d: -f7) +%s)
       
     6 TODAY=$(date +%s)
       
     7 
       
     8 if [[ $(( $EXPIRY - $TODAY )) -le $WARNTIME ]]; then
       
     9   ( echo Subject: apt.schlittermann.de Archive Signing Key is about to expire - please extend expiry date; gpg -k apt.schlittermann.de ) | /usr/sbin/sendmail $NOTIFY
       
    10 fi