feat: 更新脚本中处理命令

This commit is contained in:
2023-09-25 12:31:43 +08:00
parent e771afa3ee
commit d58a0488ed
+4 -4
View File
@@ -344,7 +344,7 @@ app_start_server_bg() {
LOG_D "Checking ${APP_NAME} ready status..."
local counter=10
while ! app_is_server_running ; do
while app_is_server_not_running ; do
LOG_D "Waiting for ${APP_NAME} to ready ... $counter"
if [[ "$counter" -ne 0 ]]; then
break
@@ -377,7 +377,7 @@ app_stop_server() {
app_is_server_running() {
LOG_D "Check if ${APP_NAME} is running..."
local pid
pid="$(get_pid_from_file '${LDAP_PID_FILE}')"
pid="$(get_pid_from_file ${LDAP_PID_FILE})"
LOG_D "${APP_NAME} PID: ${pid}"
if [[ -n "${pid}" ]]; then
@@ -520,11 +520,11 @@ app_custom_init() {
;;
*.ldif)
LOG_D "Executing $f";
postgresql_execute "${PG_DATABASE}" "${PG_INITSCRIPTS_USERNAME}" "${PG_INITSCRIPTS_PASSWORD}" < "$f"
ldapmodify -Y EXTERNAL -H "ldapi:///" -f
;;
*.ldif.gz)
LOG_D "Executing $f";
gunzip -c "$f" | postgresql_execute "${PG_DATABASE}" "${PG_INITSCRIPTS_USERNAME}" "${PG_INITSCRIPTS_PASSWORD}"
gunzip -c "$f" | ldapmodify -Y EXTERNAL -H "ldapi:///" -f
;;
*)
LOG_D "Ignoring $f" ;;