#!/usr/bin/execlineb -P

# Host keys before sshd: an image ships none, so the first start creates them.
# "ssh-keygen -A" creates only missing keys (Ubuntu: sshd-keygen.service).
foreground { /usr/bin/ssh-keygen -A }
# a configuration that sshd -t refuses does not start; sshd -t needs /run/sshd
if { mkdir -p -m 0755 /run/sshd }
if { /usr/sbin/sshd -t }
run-script-daemon ssh
