Retry pulling keys if the file is empty
This commit is contained in:
parent
79869b493c
commit
d4d6bd2c95
@ -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
|
||||
|
@ -653,7 +653,7 @@ files:
|
||||
contents: |
|
||||
#!/bin/sh
|
||||
# Retrieve ssh keys
|
||||
[ -f /var/lib/adlin/authorized_keys ] || nsenter -n/run/netns/router -- /usr/bin/wget -O /var/lib/adlin/authorized_keys https://cri.epita.fr/$(sed 's/^.*MyLogin=//p;d' /var/lib/adlin/wireguard/adlin.conf).keys
|
||||
[ -s /var/lib/adlin/authorized_keys ] || nsenter -n/run/netns/router -- /usr/bin/wget -O /var/lib/adlin/authorized_keys https://cri.epita.fr/$(sed 's/^.*MyLogin=//p;d' /var/lib/adlin/wireguard/adlin.conf).keys
|
||||
mode: "0755"
|
||||
|
||||
# - path: etc/init.d/021-correction
|
||||
|
Reference in New Issue
Block a user