diff --git a/apache/hooks/web_proxy-relation-joined b/apache/hooks/web_proxy-relation-joined index 58f1c6f..1bff937 100755 --- a/apache/hooks/web_proxy-relation-joined +++ b/apache/hooks/web_proxy-relation-joined @@ -1,15 +1,14 @@ #!/bin/bash - ## Should be executable N time in a row with same result. -. lib/common - set -e +. lib/common + apache_proxy_dir APACHE_CORE_RULES=$(relation-get apache-core-rules 2>/dev/null) || true if [ "$APACHE_CORE_RULES" ]; then - apache_core_rules_add "$APACHE_CORE_RULES" + apache_core_rules_add "$APACHE_CORE_RULES" || exit 1 fi diff --git a/apache/lib/common b/apache/lib/common index 50d993a..4c23791 100644 --- a/apache/lib/common +++ b/apache/lib/common @@ -6,7 +6,7 @@ apache_proxy_dir () { err "You must specify a ${WHITE}domain$NORMAL option in relation." return 1 } - proxy=yes apache_vhost_create + proxy=yes apache_vhost_create || return 1 info "Added $DOMAIN as a proxy to $TARGET." } export -f apache_proxy_dir @@ -40,7 +40,7 @@ apache_vhost_create () { __vhost_cfg_creds_enabled=$(relation-get creds 2>/dev/null) || true if [ "$__vhost_cfg_creds_enabled" ]; then - apache_passwd_file + apache_passwd_file || return 1 fi if is_protocol_enabled https; then