#!/bin/bash
if [ "$VIRTUALSERVER_ACTION" = "SSL_DOMAIN" ]; then
setfacl -R -m u:named:rX /etc/letsencrypt/{live,archive}/
setfacl -m u:named:rX /etc/letsencrypt/{live,archive}
fi
and chmod +x namedpermissions.sh
and put the path in Command to run after making changes to a server
Does it know that VIRTUALSERVER_ACTION" = "SSL_DOMAIN is in reference to itself? In other words does it know that the command refers to itself for something that it was doing previously? which is the whole point I guess.
This is a bit over my head, maybe I will just run a cron.
I don’t think I understand what you mean. That is a variable that is set by Virtualmin before it runs any command that has been configured to run. As discussed in that thread, when a certificate is renewed, the variable will be set to SSL_DOMAIN, and when a new domain is created it will be set to CREATE_DOMAIN, etc.
A script like this won’t do anything if called without that variable set (as it will never satisfy the test condition of being equal to SSL_DOMAIN, as it will be empty).