diff options
Diffstat (limited to 'debian/progress-linux.postinst')
-rwxr-xr-x | debian/progress-linux.postinst | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/debian/progress-linux.postinst b/debian/progress-linux.postinst index 959e4e8..ceb563d 100755 --- a/debian/progress-linux.postinst +++ b/debian/progress-linux.postinst @@ -97,6 +97,27 @@ EOF fi } +Remove_ssh_known_hosts () +{ + if [ ! -e /etc/ssh/ssh_known_hosts ] + then + return + fi + + # ssh cert-authority + grep -v "^@cert-authority \*.${DOMAIN}" /etc/ssh/ssh_known_hosts > /etc/ssh/ssh_known_hosts.tmp + + if [ "$(md5sum /etc/ssh/ssh_known_hosts.tmp | cut -d' ' -f1)" = "2a2b4fdd70705b2029b35a24217138e6" ] + then + rm -f /etc/ssh/ssh_known_hosts.tmp + rm -f /etc/ssh/ssh_known_hosts + + rmdir /etc/ssh > /dev/null 2>&1 || true + else + mv -f /etc/ssh/ssh_known_hosts.tmp /etc/ssh/ssh_known_hosts + fi +} + case "${1}" in configure) . /usr/share/debconf/confmodule @@ -109,8 +130,25 @@ case "${1}" in db_stop + DISTRIBUTION="$(cat /etc/debian_version)" + + case "${DISTRIBUTION}" in + 10.*|buster/sid) + ;; + + *) + Remove_apt_sources + Remove_apt_preferences + Remove_apt_keys + + Remove_ssh_known_hosts + + exit 0 + ;; + esac + # apt - if [ -n "${ARCHIVES}" ] + if [ -n "${ARCHIVES}" ] && [ "${ARCHIVES}" != "false" ] then Install_apt_sources Install_apt_preferences |