Jan Kundrát | 1e5dfeb | 2018-09-14 13:40:34 +0200 | [diff] [blame^] | 1 | [Unit] |
2 | Description=Store OpenSSH host keys into /cfg | ||||
3 | After=cfg.mount sshd.service | ||||
4 | Requires=cfg.mount sshd.service | ||||
5 | ConditionPathExists=!/cfg/etc/ssh/ssh_host_rsa_key | ||||
6 | |||||
7 | [Service] | ||||
8 | Type=oneshot | ||||
9 | ExecStartPre=/bin/mkdir -p /cfg/etc/ssh | ||||
10 | ExecStart=/bin/sh -c 'cp -a /etc/ssh/ssh_host_*_key* /cfg/etc/ssh/' | ||||
11 | |||||
12 | [Install] | ||||
13 | WantedBy=multi-user.target |