l sync-containers: shutdown container if already up
This commit is contained in:
parent
1fb7abde92
commit
7a654da5de
|
@ -155,6 +155,8 @@ in {
|
|||
|
||||
if [ -h /var/lib/containers/${ctr.name}/var/src/nixos-config ] && (! ping -c1 -q -w5 ${ctr.name}.r); then
|
||||
${pkgs.nixos-container}/bin/nixos-container run ${ctr.name} -- nixos-rebuild -I /var/src switch
|
||||
else
|
||||
${(stop ctr.name).${ctr.format}}
|
||||
fi
|
||||
'')
|
||||
(pkgs.writeDashBin "stop-${ctr.name}" ''
|
||||
|
|
Loading…
Reference in a new issue