Retry pulling keys if the file is empty

This commit is contained in:
nemunaire 2022-04-29 13:36:58 +02:00
commit d4d6bd2c95
2 changed files with 2 additions and 2 deletions

View file

@ -159,7 +159,7 @@ files:
# Retrieve ssh keys
mkdir -p root/.ssh/
[ -f root/.ssh/authorized_keys ] || /usr/sbin/chroot . /usr/bin/curl -s -f https://cri.epita.fr/$(sed 's/^.*MyLogin=//p;d' etc/wireguard/adlin.conf).keys > root/.ssh/authorized_keys
[ -s root/.ssh/authorized_keys ] || /usr/sbin/chroot . /usr/bin/curl -s -f https://cri.epita.fr/$(sed 's/^.*MyLogin=//p;d' etc/wireguard/adlin.conf).keys > root/.ssh/authorized_keys
[ -f etc/ssh/ssh_host_rsa_key ] || /usr/sbin/chroot . ssh-keygen -A
# To the user