Skip to content

Instantly share code, notes, and snippets.

@mokiding
Created February 27, 2017 09:03
Show Gist options
  • Save mokiding/d068d4175cb0d5184888bbf7a0d3f0d7 to your computer and use it in GitHub Desktop.
Save mokiding/d068d4175cb0d5184888bbf7a0d3f0d7 to your computer and use it in GitHub Desktop.
#!/bin/bash
cert_src="/home/admin/conf/web/ssl.tesla.m0k1.net.pem"
key_src="/home/admin/conf/web/ssl.tesla.m0k1.net.key"
cert_dst="/usr/local/vesta/ssl/certificate.crt"
key_dst="/usr/local/vesta/ssl/certificate.key"
if ! cmp -s $cert_dst $cert_src
then
# Copy Certificate
cp $cert_src $cert_dst
# Copy Keyfile
cp $key_src $key_dst
# Change Permission
chown root:mail $cert_dst
chown root:mail $key_dst
# Restart Services
service vesta restart &> /dev/null
service exim4 restart &> /dev/null
fi
chmod +x /etc/cron.daily/vesta_ssl
@mokiding
Copy link
Author

nano /etc/cron.daily/vesta_ssl
then paste this code and then
chmod +x /etc/cron.daily/vesta_ssl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment