diff --git a/rootfs/overlay/usr/lib/systemd/system-generators/fetch-sshkeys-generator b/rootfs/overlay/usr/lib/systemd/system-generators/fetch-sshkeys-generator new file mode 100755 index 0000000..d738106 --- /dev/null +++ b/rootfs/overlay/usr/lib/systemd/system-generators/fetch-sshkeys-generator @@ -0,0 +1,25 @@ +#!/bin/sh + +enable_unit() { + mkdir -p "${normaldir}"/multi-user.target.wants + ln -s /lib/systemd/system/"$1" "${normaldir}"/multi-user.target.wants/ +} + +normaldir="$1" +# shellcheck disable=SC2034 +earlydir="$2" +# shellcheck disable=SC2034 +latedir="$3" + +# shellcheck disable=SC2046 +set -- $(cat /proc/cmdline) +while [ $# -ge 1 ]; do + case "$1" in + sshkeys.*=*) + arg=${1#*.} + user=${arg%=*} + enable_unit fetch-sshkeys@"${user}".service + ;; + esac + shift +done diff --git a/rootfs/overlay/usr/lib/systemd/system/multi-user.target.wants/fetch-sshkeys@root.service b/rootfs/overlay/usr/lib/systemd/system/multi-user.target.wants/fetch-sshkeys@root.service deleted file mode 120000 index 69e757b..0000000 --- a/rootfs/overlay/usr/lib/systemd/system/multi-user.target.wants/fetch-sshkeys@root.service +++ /dev/null @@ -1 +0,0 @@ -../fetch-sshkeys@.service \ No newline at end of file