Created
February 27, 2017 09:03
-
-
Save mokiding/d068d4175cb0d5184888bbf7a0d3f0d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nano /etc/cron.daily/vesta_ssl
then paste this code and then
chmod +x /etc/cron.daily/vesta_ssl