summaryrefslogtreecommitdiff
path: root/get-authorized-keys
diff options
context:
space:
mode:
Diffstat (limited to 'get-authorized-keys')
-rwxr-xr-xget-authorized-keys12
1 files changed, 12 insertions, 0 deletions
diff --git a/get-authorized-keys b/get-authorized-keys
new file mode 100755
index 0000000..8c24017
--- /dev/null
+++ b/get-authorized-keys
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+set -euo pipefail
+
+if [ ! -e /root/.ssh/authorized_keys ]; then
+ if mount -r LABEL=v-i-config /mnt; then
+ if [ -e /mnt/authorized_keys ]; then
+ cp /mnt/authorized_keys /root/.ssh/authorized_keys
+ fi
+ umount /mnt
+ fi
+fi