Skip to content

Instantly share code, notes, and snippets.

@Chaz6
Last active August 22, 2022 11:35
Show Gist options
  • Save Chaz6/acf4774b8d71f153f51af57b8ea8bcda to your computer and use it in GitHub Desktop.
Save Chaz6/acf4774b8d71f153f51af57b8ea8bcda to your computer and use it in GitHub Desktop.
Script to update weechat relay ssl certificate using LetsEncrypt
#!/bin/bash
/usr/bin/certbot renew
if /usr/bin/test $(find /etc/letsencrypt/live/weechat.example.com/cert.pem -mmin -60)
then
/bin/cat /etc/letsencrypt/live/weechat.example.com/cert.pem /etc/letsencrypt/live/weechat.example.com/privkey.pem > /home/user/.weechat/ssl/weechat.example.com_ssl.pem
/bin/cat /etc/letsencrypt/live/weechat.example.com/fullchain.pem > /home/user/.weechat/ssl/weechat.example.com_fullchain.pem
/usr/bin/su -c 'echo "*/relay sslcertkey" > /home/user/.weechat/weechat_fifo_*' user
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment