diskimage-builder/elements/simple-init/cleanup.d/90-remove-ssh-host-keys
Clint Byrum 4ceb40e13d simple-init: Fix path for /etc/ssh test
The cleanup path was fixed, but not the actual test.

Change-Id: If9ff4ee55604fa317a9a5bda0eee0b2783ef079a
2016-04-13 14:53:21 -07:00

18 lines
409 B
Bash
Executable file

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# Cloud images shouldn't have ssh host keys baked
# in so that they are regenerated on first boot and
# are unique.
# TODO(greghaynes) This should be a thing we do for all images, not just
# simple-init.
if [ -d $TARGET_ROOT/etc/ssh ] ; then
sudo find $TARGET_ROOT/etc/ssh -name 'ssh_host*' -type f -delete
fi