dustin
/
jenkinsagent
Archived
1
0
Fork 0
This repository has been archived on 2023-11-14. You can view files and clone it, but cannot push or open issues/pull-requests.
jenkinsagent/rootfs/overlay/usr/lib/systemd/system-generators/fetch-sshkeys-generator

26 lines
499 B
Bash
Executable File

#!/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