Don't switch the configuration when we reboot the Pis

This commit is contained in:
Andreas Zweili 2023-06-19 11:46:54 +02:00
parent 8c180a0704
commit 0926fd637d
1 changed files with 4 additions and 2 deletions

View File

@ -31,8 +31,10 @@ do
fi
fqdn="$host.2li.local"
echo $fqdn
nixos-rebuild switch -j auto --use-remote-sudo --target-host $fqdn --flake ".#$host" &&
if [ $reboot -eq 1 ]; then
if [ $reboot -eq 0 ]; then
nixos-rebuild switch -j auto --use-remote-sudo --target-host $fqdn --flake ".#$host" &&
else
nixos-rebuild boot -j auto --use-remote-sudo --target-host $fqdn --flake ".#$host" &&
ssh -i $rsa_key $fqdn 'sudo reboot'
fi
echo