#!/bin/bashfunction age() { local filename=$1 local changed=`stat -c %Y "$filename"` local now=`date +%s` local elapsed let elapsed=now-changed echo $elapsed}/root/pki/fetch.sh# push new certs if less that 7.5d oldif [ $(age "/root/pki/cert.pem") -lt 648000 ]; then /root/pki/push.shfi
#!/bin/shrsync --checksum -Ltve 'ssh' root@192.168.xx.yy:/etc/letsencrypt/live/[mydomain]/* /root/pki/
#!/bin/shecho Pushing configscp /root/pki/*.pem root@192.168.aaa.bbb:/etc/pki/tls/letsencrypt/scp /root/pki/*.pem root@192.168.ccc.ddd:/etc/pki/tls/letsencrypt/[...]echo Restarting remote servicesssh root@192.168.aaa.bbb "systemctl restart postfix"ssh root@192.168.aaa.bbb "systemctl restart dovecot"ssh root@192.168.ccc.ddd "systemctl restart apache2"[...]