packer-hcloud/rocky-9/data/files/hcloud-metadata
Robert Kaussow 78e049f6e0
Some checks failed
continuous-integration/drone/push Build is failing
initial commit
2022-09-08 15:13:44 +02:00

15 lines
298 B
Bash

#!/usr/bin/env bash
set -eo pipefail
case "$1" in
keys)
if [ ! -f /root/.ssh/authorized_keys ]; then
curl -SsfL http://169.254.169.254/hetzner/v1/metadata/public-keys | /usr/bin/jq -r '.[]' >/root/.ssh/authorized_keys
fi
;;
*)
echo "Invalid command"
exit 3
;;
esac