#!/bin/bash

## Should be executable N time in a row with same result.

. lib/common

set -e

service_def=$(get_compose_service_def "$SERVICE_NAME")

cfg=$(relation-get)
apache_publish_dir "$cfg" "$service_def"

APACHE_CORE_RULES=$(relation-get apache-core-rules 2>/dev/null) || true
if [ "$APACHE_CORE_RULES" ]; then
    apache_core_rules_add "$APACHE_CORE_RULES"
fi