1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-03 05:02:40 +02:00

Fix: waiting for all background jobs to finish before send snapshot (#1720)

This commit is contained in:
Nazim-ua
2021-04-13 22:36:05 +03:00
committed by GitHub
parent 116c1ad53d
commit 3935ddfd50

View File

@@ -131,6 +131,12 @@ send_snapshot() {
$smbclient_cmd -D "$smb_stills_path" -c "lcd /tmp; mkdir $groupname; cd $groupname; put $snapshot_tempfilename; rename $snapshot_tempfilename $filename.jpg"
) &
fi
# Wait for all background jobs to finish before existing
debug_msg "Waiting for background jobs to end in send_snapshot function:"
for jobpid in $(jobs -p); do
wait "$jobpid"
debug_msg "Job in send_snapshot function $jobpid ended"
done
}