From 876ff0c330d1997ffbc06b72fb81845b1eec0076 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 8 Mar 2019 23:49:25 -0500 Subject: [PATCH] chore: minor consolidation in functions files --- functions | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/functions b/functions index c102606..22d4da7 100755 --- a/functions +++ b/functions @@ -8,8 +8,6 @@ if [[ -f "$PLUGIN_AVAILABLE_PATH/docker-options/functions" ]]; then source "$PLUGIN_AVAILABLE_PATH/docker-options/functions" fi -# non-generic functions - service_connect() { local SERVICE="$1" local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" @@ -42,6 +40,8 @@ service_create() { mkdir -p "$SERVICE_ROOT" || dokku_log_fail "Unable to create service directory" mkdir -p "$SERVICE_ROOT/data" || dokku_log_fail "Unable to create service data directory" mkdir -p "$SERVICE_ROOT/config" || dokku_log_fail "Unable to create service config directory" + touch "$LINKS_FILE" + if [[ -z $REDIS_CONFIG_PATH ]] ; then curl -sSL "https://raw.githubusercontent.com/antirez/redis/${PLUGIN_IMAGE_VERSION:0:3}/redis.conf" > "$SERVICE_ROOT/config/redis.conf" || dokku_log_fail "Unable to download the default redis.conf to the config directory" else @@ -55,7 +55,6 @@ service_create() { echo "$PASSWORD" > "$SERVICE_ROOT/PASSWORD" chmod 640 "$SERVICE_ROOT/PASSWORD" sed -i.bak "s/# requirepass.*/requirepass ${PASSWORD}/" "$SERVICE_ROOT/config/redis.conf" && rm "$SERVICE_ROOT/config/redis.conf.bak" - touch "$LINKS_FILE" [[ -n "$SERVICE_CUSTOM_ENV" ]] && REDIS_CUSTOM_ENV="$SERVICE_CUSTOM_ENV" if [[ -n $REDIS_CUSTOM_ENV ]]; then