From d15e1037041a59b9f2edebf8744f7ee7fc1721cd Mon Sep 17 00:00:00 2001 From: dpeca Date: Thu, 14 Feb 2019 18:29:56 +0100 Subject: [PATCH] Allow admins to run custom script after SSL is put to any domain Useful if you have separated SSLs for each IP address. If admin add to vesta.conf this: UPDATE_SSL_SCRIPT='/usr/local/bin/update_ssl_script.sh' that script will be called after each domain get new SSL or renew old SSL. Then admin can write custom script that will, for example, copy new SSL to some file that is needed for dovecot or exim, for example... Passed parameters are $user and $domain ($1 and $2), so custom script can check what domain got new SSL, and then to run custom task... --- bin/v-add-web-domain-ssl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/v-add-web-domain-ssl b/bin/v-add-web-domain-ssl index 55c4ce41..a006d072 100755 --- a/bin/v-add-web-domain-ssl +++ b/bin/v-add-web-domain-ssl @@ -127,6 +127,10 @@ if [ ! -z "$UPDATE_HOSTNAME_SSL" ] && [ "$UPDATE_HOSTNAME_SSL" = "yes" ]; then fi fi +if [ ! -z "$UPDATE_SSL_SCRIPT" ]; then + eval "$UPDATE_SSL_SCRIPT $user $domain" +fi + # Logging log_history "enabled ssl support for $domain" log_event "$OK" "$ARGUMENTS"