diskimage-builder/elements/local-config/install.d/62-ssh-key

13 lines
369 B
Plaintext
Raw Normal View History

2012-11-09 11:04:13 +00:00
#!/bin/bash
# Save user SSH public key if available.
# XXX: Obviously not suitable for downloadable images.
set -e
if [ -e "/tmp/in_target.d/ssh-authorized-keys" ]; then
2012-11-22 04:58:07 +00:00
if [ -d ~stack ]; then
sudo -u stack mkdir ~stack/.ssh
sudo -Hiu stack dd of=~stack/.ssh/authorized_keys oflag=append conv=notrunc if=/tmp/in_target.d/ssh-authorized-keys
fi
2012-11-09 11:04:13 +00:00
fi