2018-07-26 09:53:56 -04:00
|
|
|
#!/usr/bin/env bash
|
2019-01-07 01:04:17 -05:00
|
|
|
set -eo pipefail
|
|
|
|
|
[[ $DOKKU_TRACE ]] && set -x
|
2018-07-26 09:53:56 -04:00
|
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
|
|
|
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/internal-functions"
|
|
|
|
|
|
2022-01-28 20:17:49 -05:00
|
|
|
fn-trigger-nginx-vhosts-proxy-clear-config-app() {
|
|
|
|
|
declare desc="clears the proxy config for a single app"
|
2018-07-26 09:53:56 -04:00
|
|
|
declare APP="$1"
|
|
|
|
|
|
2020-02-10 02:40:59 -05:00
|
|
|
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
2020-02-22 06:35:30 -05:00
|
|
|
if [[ "$(plugn trigger proxy-type "$APP")" == "nginx" ]]; then
|
2018-07-26 09:53:56 -04:00
|
|
|
plugn trigger network-clear-config "$APP"
|
|
|
|
|
nginx_clear_config "$APP"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-28 20:17:49 -05:00
|
|
|
trigger-nginx-vhosts-proxy-clear-config() {
|
|
|
|
|
declare desc="clear nginx config for proxy app containers from command line"
|
|
|
|
|
declare trigger="proxy-clear-config"
|
|
|
|
|
declare APP="$1"
|
|
|
|
|
|
|
|
|
|
if [[ "$APP" == "--all" ]]; then
|
|
|
|
|
exit_code="0"
|
|
|
|
|
for app in $(dokku_apps); do
|
|
|
|
|
if ! fn-trigger-nginx-vhosts-proxy-clear-config-app "$app"; then
|
|
|
|
|
exit_code="$?"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
return "$exit_code"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
fn-trigger-nginx-vhosts-proxy-clear-config-app "$APP"
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-10 02:40:59 -05:00
|
|
|
trigger-nginx-vhosts-proxy-clear-config "$@"
|