summaryrefslogtreecommitdiffstats
path: root/remote/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys')
-rwxr-xr-xremote/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys18
1 files changed, 18 insertions, 0 deletions
diff --git a/remote/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys b/remote/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys
new file mode 100755
index 00000000..08ad7d2c
--- /dev/null
+++ b/remote/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys
@@ -0,0 +1,18 @@
+#!/bin/ash
+
+AUTH_KEYS_DIR="/root/.ssh/authorized_keys.d/"
+AUTH_KEYS_FILE="/root/.ssh/authorized_keys"
+
+# do we even have the directory?
+[ ! -d "$AUTH_KEYS_DIR" ] && echo "No such directory: $AUTH_KEYS_DIR" && exit 1
+
+# ok, lets cat them in the real file
+for KEY in "$AUTH_KEYS_DIR"/* ; do
+ if ! cat $KEY >> "$AUTH_KEYS_FILE" ; then
+ echo "Could not add '$KEY' to '$AUTH_KEYS_FILE'"
+ exit 1
+ fi
+done
+
+# all done, all good
+exit 0