From 5fbcc005360e06421dafbe0e6ac31ab787d42de2 Mon Sep 17 00:00:00 2001 From: seoseonyu Date: Thu, 1 Feb 2024 23:18:10 +0900 Subject: [PATCH] Add Wait for restore to complete --- scripts/init.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/init.sh b/scripts/init.sh index 8a216c23c..d43c43d7b 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -36,3 +36,11 @@ if [ "${#backup_pids[@]}" -ne 0 ]; then tail --pid="$pid" -f 2>/dev/null done fi + +mapfile -t restore_pids < <(pgrep restore) +if [ "${#restore_pids[@]}" -ne 0 ]; then + echo "Waiting for restore to finish" + for pid in "${restore_pids[@]}"; do + tail --pid="$pid" -f 2>/dev/null + done +fi