diff --git a/apache/lib/common b/apache/lib/common index 9b6d3661..51ac8f54 100644 --- a/apache/lib/common +++ b/apache/lib/common @@ -1,5 +1,6 @@ # -*- mode: shell-script -*- +config_hash= apache_proxy_dir () { DOMAIN=$(relation-get domain) || { @@ -150,6 +151,7 @@ ssl_fallback_prepare() { if [ "$content" ]; then location="$(eval echo "\$__vhost_cfg_SSL_${label^^}_LOCATION")" echo "$content" | file_put "$dst$location" + config_hash=$(printf "%s\0" "$config_hash" "$label" "$content" | md5_compat) volumes="$volumes - $dst$location:$location:ro" fi @@ -314,6 +316,7 @@ apache_core_rules_add() { local conf="$1" dst="/etc/apache2/conf-enabled/$BASE_SERVICE_NAME.conf" debug "Adding core rule." echo "$conf" | file_put "$CONFIGSTORE/$BASE_SERVICE_NAME$dst" + config_hash=$(printf "%s\0" "$config_hash" "$conf" | md5_compat) config-add " $MASTER_BASE_SERVICE_NAME: volumes: @@ -514,8 +517,11 @@ EOF apache_config_hash() { debug "Adding config hash to enable recreating upon config change." - config_hash=$(find "$SERVICE_CONFIGSTORE/etc/apache2/sites-enabled" \ - -name \*.conf -exec md5sum {} \; | md5_compat) || exit 1 + config_hash=$({ + printf "%s\0" "$config_hash" + find "$SERVICE_CONFIGSTORE/etc/apache2/sites-enabled" \ + -name \*.conf -exec md5sum {} \; + } | md5_compat) || exit 1 init-config-add " $MASTER_BASE_SERVICE_NAME: labels: