Move get and set actions into functions

This commit is contained in:
Jose Diaz-Gonzalez
2015-09-01 00:52:40 -04:00
parent a62f914646
commit 7b5ea80ea4
5 changed files with 82 additions and 70 deletions

View File

@@ -1,8 +1,9 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_PATH/config/functions"
APP="$1"
NO_VHOST=$(dokku config:get $APP NO_VHOST || true)
NO_VHOST=$(config_get $APP NO_VHOST || true)
RE_IPV4="([0-9]{1,3}[\.]){3}[0-9]{1,3}"

View File

@@ -1,10 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_PATH/common/functions"
source "$PLUGIN_PATH/config/functions"
APP="$1"
if [[ -f "$DOKKU_ROOT/$APP/IP.web.1" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT.web.1" ]]; then
NO_VHOST=$(dokku config:get $APP NO_VHOST || true)
NO_VHOST=$(config_get $APP NO_VHOST || true)
if [[ -n "$NO_VHOST" ]]; then
dokku_log_info1 "NO_VHOST config detected"