Added POSTGRESQL_PREINITSCRIPTS_DIR env to run scripts before postgresql start

This commit is contained in:
Alfred Heisner 2019-08-30 14:19:59 -05:00
parent 23bc17f699
commit f1b8e571a3
9 changed files with 45 additions and 9 deletions

View File

@ -560,7 +560,11 @@ postgresql_custom_pre_init_scripts() {
if [[ -n $(find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh") ]]; then
info "Loading user's custom files from $POSTGRESQL_PREINITSCRIPTS_DIR ...";
find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh" | sort | while read -r f; do
debug "Executing $f"; "$f"
if [[ -x "$f" ]]; then
debug "Executing $f"; "$f"
else
debug "Sourcing $f"; . "$f"
fi
done
fi
}

View File

@ -560,7 +560,11 @@ postgresql_custom_pre_init_scripts() {
if [[ -n $(find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh") ]]; then
info "Loading user's custom files from $POSTGRESQL_PREINITSCRIPTS_DIR ...";
find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh" | sort | while read -r f; do
debug "Executing $f"; "$f"
if [[ -x "$f" ]]; then
debug "Executing $f"; "$f"
else
debug "Sourcing $f"; . "$f"
fi
done
fi
}

View File

@ -560,7 +560,11 @@ postgresql_custom_pre_init_scripts() {
if [[ -n $(find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh") ]]; then
info "Loading user's custom files from $POSTGRESQL_PREINITSCRIPTS_DIR ...";
find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh" | sort | while read -r f; do
debug "Executing $f"; "$f"
if [[ -x "$f" ]]; then
debug "Executing $f"; "$f"
else
debug "Sourcing $f"; . "$f"
fi
done
fi
}

View File

@ -560,7 +560,11 @@ postgresql_custom_pre_init_scripts() {
if [[ -n $(find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh") ]]; then
info "Loading user's custom files from $POSTGRESQL_PREINITSCRIPTS_DIR ...";
find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh" | sort | while read -r f; do
debug "Executing $f"; "$f"
if [[ -x "$f" ]]; then
debug "Executing $f"; "$f"
else
debug "Sourcing $f"; . "$f"
fi
done
fi
}

View File

@ -560,7 +560,11 @@ postgresql_custom_pre_init_scripts() {
if [[ -n $(find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh") ]]; then
info "Loading user's custom files from $POSTGRESQL_PREINITSCRIPTS_DIR ...";
find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh" | sort | while read -r f; do
debug "Executing $f"; "$f"
if [[ -x "$f" ]]; then
debug "Executing $f"; "$f"
else
debug "Sourcing $f"; . "$f"
fi
done
fi
}

View File

@ -560,7 +560,11 @@ postgresql_custom_pre_init_scripts() {
if [[ -n $(find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh") ]]; then
info "Loading user's custom files from $POSTGRESQL_PREINITSCRIPTS_DIR ...";
find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh" | sort | while read -r f; do
debug "Executing $f"; "$f"
if [[ -x "$f" ]]; then
debug "Executing $f"; "$f"
else
debug "Sourcing $f"; . "$f"
fi
done
fi
}

View File

@ -560,7 +560,11 @@ postgresql_custom_pre_init_scripts() {
if [[ -n $(find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh") ]]; then
info "Loading user's custom files from $POSTGRESQL_PREINITSCRIPTS_DIR ...";
find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh" | sort | while read -r f; do
debug "Executing $f"; "$f"
if [[ -x "$f" ]]; then
debug "Executing $f"; "$f"
else
debug "Sourcing $f"; . "$f"
fi
done
fi
}

View File

@ -560,7 +560,11 @@ postgresql_custom_pre_init_scripts() {
if [[ -n $(find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh") ]]; then
info "Loading user's custom files from $POSTGRESQL_PREINITSCRIPTS_DIR ...";
find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh" | sort | while read -r f; do
debug "Executing $f"; "$f"
if [[ -x "$f" ]]; then
debug "Executing $f"; "$f"
else
debug "Sourcing $f"; . "$f"
fi
done
fi
}

View File

@ -560,7 +560,11 @@ postgresql_custom_pre_init_scripts() {
if [[ -n $(find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh") ]]; then
info "Loading user's custom files from $POSTGRESQL_PREINITSCRIPTS_DIR ...";
find "$POSTGRESQL_PREINITSCRIPTS_DIR/" -type f -name "*.sh" | sort | while read -r f; do
debug "Executing $f"; "$f"
if [[ -x "$f" ]]; then
debug "Executing $f"; "$f"
else
debug "Sourcing $f"; . "$f"
fi
done
fi
}