Skip to content

Commit a6d7c3c

Browse files
committed
cleanup path folders
1 parent 0ad0fd0 commit a6d7c3c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

rootfs/container/functions/10-postgres

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ EOSQL
7070

7171
fi
7272

73-
if ! grep -q "${MONITOR_USER}" "${CONFIG_PATH}"/"${HBA_FILE}" ; then
73+
if ! grep -q "${MONITOR_USER}" "${CONFIG_PATH%/}"/"${HBA_FILE}" ; then
7474
print_notice "[configure_monitoring] Adding '${MONITOR_USER}' to '${HBA_FILE}'"
75-
echo "host all ${MONITOR_USER} localhost md5" >> "${CONFIG_PATH}"/"${HBA_FILE}"
75+
echo "host all ${MONITOR_USER} localhost md5" >> "${CONFIG_PATH%/}"/"${HBA_FILE}"
7676
fi
7777
else
7878
print_debug "[configure_monitoring] Deleting Monitor User: '${MONITOR_USER}'"
@@ -107,9 +107,9 @@ configure_replication() {
107107
EOSQL
108108
fi
109109

110-
if ! grep -q "${REPLICATION_USER}" "${CONFIG_PATH}"/"${HBA_FILE}" ; then
110+
if ! grep -q "${REPLICATION_USER}" "${CONFIG_PATH%/}"/"${HBA_FILE}" ; then
111111
print_notice "[configure_replication] Adding '${REPLICATION_USER}/${REPLICATION_IP_ALLOW}' to '${HBA_FILE}'"
112-
echo "host replication ${REPLICATION_USER} ${REPLICATION_IP_ALLOW} md5" >> "${CONFIG_PATH}"/"${HBA_FILE}"
112+
echo "host replication ${REPLICATION_USER} ${REPLICATION_IP_ALLOW} md5" >> "${CONFIG_PATH%/}"/"${HBA_FILE}"
113113
fi
114114
;;
115115
esac
@@ -225,15 +225,15 @@ configure_server() {
225225
case "${LOG_FORMAT,,}" in
226226
csv )
227227
log_format=csvlog
228-
create_logrotate postgresql "${LOG_PATH}"/"${LOG_FILE%.*}".csv postgres postgres
228+
create_logrotate postgresql "${LOG_PATH%/}"/"${LOG_FILE%.*}".csv postgres postgres
229229
;;
230230
json )
231231
log_format=jsonlog
232-
create_logrotate postgresql "${LOG_PATH}"/"${LOG_FILE%.*}".json postgres postgres
232+
create_logrotate postgresql "${LOG_PATH%/}"/"${LOG_FILE%.*}".json postgres postgres
233233
;;
234234
normal | default | stderr | * )
235235
log_format=stderr
236-
create_logrotate postgresql "${LOG_PATH}"/"${LOG_FILE}" postgres postgres
236+
create_logrotate postgresql "${LOG_PATH%/}"/"${LOG_FILE}" postgres postgres
237237
;;
238238
esac
239239
;;
@@ -280,7 +280,7 @@ EOREPLICATIONHOTSTANDBY
280280
sanity_var "REPLICATION_PORT" "listening port of replication host"
281281
sanity_var "REPLICATION_USER" "replication user on replication host"
282282
sanity_var "REPLICATION_PASS" "replication password for user on replication host"
283-
cat <<EOREPLICATIONRECOVERY | silent sudo -u postgres tee "${CONFIG_CUSTOM_PATH}"/replication-recovery.conf
283+
cat <<EOREPLICATIONRECOVERY | silent sudo -u postgres tee "${CONFIG_CUSTOM_PATH%/}"/replication-recovery.conf
284284
standby_mode = 'on'
285285
primary_conninfo = 'host=${REPLICATION_HOST} port=${REPLICATION_PORT} user=${REPLICATION_USER} password=${REPLICATION_PASS} sslmode=${REPLICATION_SSLMODE}'
286286
EOREPLICATIONRECOVERY
@@ -365,7 +365,7 @@ initialize_cluster() {
365365
--username=${SUPERUSER_USER} \
366366
--pwfile=/tmp/.pgpassword \
367367
${initdb_args} ${DATA_PATH}
368-
rm -rf "${DATA_PATH}"/*.conf \
368+
rm -rf "${DATA_PATH%/}"/*.conf \
369369
/tmp/.pgpassword
370370
fi
371371
if [ "$(dirname ${CONFIG_CUSTOM_PATH%/})" = "${DATA_PATH%/}" ] ; then

0 commit comments

Comments
 (0)