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 |
Jan Kundrát | 8929782 | 2021-01-19 21:48:52 +0100 | [diff] [blame] | 9 | RemainAfterExit=yes |
Jan Kundrát | 1e5dfeb | 2018-09-14 13:40:34 +0200 | [diff] [blame] | 10 | ExecStartPre=/bin/mkdir -p /cfg/etc/ssh |
| 11 | ExecStart=/bin/sh -c 'cp -a /etc/ssh/ssh_host_*_key* /cfg/etc/ssh/' |
| 12 | |
| 13 | [Install] |
| 14 | WantedBy=multi-user.target |