40DeleteSSHKeys.sh 597 Bytes
Newer Older
1
#! /bin/bash
Nikos Skalkotos's avatar
Nikos Skalkotos committed
2
3
4

### BEGIN TASK INFO
# Provides:		DeleteSSHKeys
Nikos Skalkotos's avatar
Nikos Skalkotos committed
5
# Requires:             MountImage
Nikos Skalkotos's avatar
Nikos Skalkotos committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Short-Description:	Remove ssh keys if present.
### END TAST INFO

set -e
. /usr/share/snf-image/common.sh


if [ "$SNF_IMAGE_TYPE" != "extdump" ]; then
    exit 0
fi

HOST_KEY="/etc/ssh/ssh_host_key"
RSA_KEY="/etc/ssh/ssh_host_rsa_key"
DSA_KEY="/etc/ssh/ssh_host_dsa_key"

for key in $HOST_KEY $RSA_KEY $DSA_KEY ; do
    if [ -f "${SNF_IMAGE_TARGET}/${key}" ] ; then
        rm -f ${SNF_IMAGE_TARGET}/${key}*
    fi
done

cleanup
trap - EXIT

exit 0

# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :