mac-exec: wait for background jobs to complete
Co-Authored-By: Jörg Thalheim <joerg@thalheim.io> Co-Authored-By: Vladimír Čunát <v@cunat.cz>
Martin Weinelt committed
Dec 19, 2024 at 03:14 UTC
63ea54bff9b83bea9a2307006defe17402da9c76
1 file changed
+4
macs/mac-exec
+4
@@ -9,8 +9,12 @@ HOSTS=(
9
"customer@eager-heisenberg.mac.nixos.org"
10
"customer@kind-lumiere.mac.nixos.org"
11
)
12
+PIDS=()
13
14
for host in "${HOSTS[@]}"; do
15
# shellcheck disable=SC2068
16
(ssh "${host}" -- $@ 2>&1| sed -e "s/^/${host} | /") &
17
+ PIDS+=($!)
18
done
19
+
20
+wait "${PIDS[@]}"