Files
addons/ssh/rootfs/etc/cont-init.d/keygen.sh
Pascal Vizeli 1abda8bfed SSH: Use new banner and tempio (#1800)
* SSH: Use new banner and tempio

* fix change for tests

* Update ssh/build.json

Co-authored-by: Franck Nijhof <git@frenck.dev>

* fix build

Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-02-02 19:05:08 +01:00

17 lines
581 B
Bash

#!/usr/bin/with-contenv bashio
# ==============================================================================
# SSH Host keys
# ==============================================================================
readonly KEYS_PATH=/data/host_keys
if ! bashio::fs.directory_exists "${KEYS_PATH}"; then
bashio::log.info "Generating host keys..."
mkdir -p "${KEYS_PATH}"
ssh-keygen -A || bashio::exit.nok "Failed to create host keys!"
cp -fp /etc/ssh/ssh_host* "${KEYS_PATH}/"
else
bashio::log.info "Restoring host keys..."
cp -fp "${KEYS_PATH}"/* /etc/ssh/
fi