service/initrd-ssh: improve login logic
Some checks failed
/ Build Nix targets (push) Has been cancelled

This commit is contained in:
Felix Buehler 2026-04-19 14:50:52 +02:00
parent 16cc7e4dfa
commit 583ea7d3a7

View file

@ -35,7 +35,7 @@ in
}; };
postCommands = lib.optionalString (cfg.mode == "grub2") '' postCommands = lib.optionalString (cfg.mode == "grub2") ''
echo 'cryptsetup-askpass || echo "Unlock was successful; exiting SSH session" && exit 1' >> /root/.profile echo 'cryptsetup-askpass && { echo "Unlock was successful; exiting SSH session"; exit 0; }' >> /root/.profile
''; '';
}; };
@ -49,7 +49,7 @@ in
unitConfig.DefaultDependencies = "no"; unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script = '' script = ''
echo 'systemctl default || echo "Unlock was successful; exiting SSH session" && exit 1' >> /var/empty/.profile echo 'systemctl default && { echo "Unlock was successful; exiting SSH session"; exit 0; }' >> /var/empty/.profile
''; '';
}; };
}; };