# This file is part of cloud-init. See LICENSE file for license information.
# rhels' version of logger_opts does not support long
# form of -s (--stderr), so use short form.
# Need to end the options list with "--" to ensure that any minus symbols
# in the text passed to logger are not interpreted as logger options.
logger_opts="$logger_opts -p user.info -t cloud-init --"
# shellcheck disable=SC2086 # logger give error if $logger_opts quoted
logger $logger_opts "$log_message"
# Redirect stderr to stdout
fingerprint_header_shown=0
for f in /etc/ssh/ssh_host_*key.pub; do
# shellcheck disable=SC2034 # Unused "line" required for word splitting
read -r ktype line < "$f"
# skip the key if its type is in the blacklist
[ "${fp_blist#*,$ktype,}" = "${fp_blist}" ] || continue
if [ $fingerprint_header_shown -eq 0 ]; then
do_syslog "#############################################################"
do_syslog "-----BEGIN SSH HOST KEY FINGERPRINTS-----"
fingerprint_header_shown=1
do_syslog "$(ssh-keygen -l -f "$f")"
if [ $fingerprint_header_shown -eq 1 ]; then
do_syslog "-----END SSH HOST KEY FINGERPRINTS-----"
do_syslog "#############################################################"