aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pkgs/populate/default.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix
index d58d9ac..5472b5d 100644
--- a/pkgs/populate/default.nix
+++ b/pkgs/populate/default.nix
@@ -777,5 +777,8 @@ writers.writeDash "populate.${target.host}" ''
${concatStringsSep "\n" (mapAttrsToList (populate target) source)}
${flakes target source}
- ${ssh' target} -q -O stop ${quote target.host}
+ # Stop the ssh master, if any source started one.
+ if ${ssh' target} -q -O check ${quote target.host} 2>/dev/null; then
+ ${ssh' target} -q -O stop ${quote target.host}
+ fi
''