blob: a07676bea4e4ee24220983a61b1f094dca89e113 [file] [log] [blame]
[Unit]
Description=SSH Key Generation
[Service]
# Set the default RSA key path then load environment variables from the
# environment file, which might override the default RSA key path.
Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
EnvironmentFile=-/etc/default/dropbear
Type=oneshot
ExecStart=@BASE_BINDIR@/sh -c \
"if [[ ! -f ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key ]]; then \
@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR}; \
@SBINDIR@/dropbearkey -t rsa -f ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key; \
fi"
ExecStart=@BASE_BINDIR@/sh -c \
"if [[ ! -f ${DROPBEAR_RSAKEY_DIR}/dropbear_ecdsa_host_key ]]; then \
@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR}; \
@SBINDIR@/dropbearkey -t ecdsa -f ${DROPBEAR_RSAKEY_DIR}/dropbear_ecdsa_host_key -s 384; \
fi"
ExecStart=@BASE_BINDIR@/sh -c \
"if [[ ! -f ${DROPBEAR_RSAKEY_DIR}/dropbear_ed25519_host_key ]]; then \
@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR}; \
@SBINDIR@/dropbearkey -t ed25519 -f ${DROPBEAR_RSAKEY_DIR}/dropbear_ed25519_host_key; \
fi"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target