| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
PROJECT="progress-linux" |
| 6 |
DOMAIN="progress-linux.org" |
| 7 |
|
| 8 |
Remove_apt_sources () |
| 9 |
{ |
| 10 |
# apt sources |
| 11 |
rm -f "/etc/apt/sources.list.d/${PROJECT}.sources" |
| 12 |
} |
| 13 |
|
| 14 |
Remove_apt_preferences () |
| 15 |
{ |
| 16 |
# apt preferences |
| 17 |
rm -f "/etc/apt/preferences.d/${PROJECT}.pref" |
| 18 |
} |
| 19 |
|
| 20 |
Remove_ssh_known_hosts () |
| 21 |
{ |
| 22 |
if [ ! -e /etc/ssh/ssh_known_hosts ] |
| 23 |
then |
| 24 |
return |
| 25 |
fi |
| 26 |
|
| 27 |
# ssh cert-authority |
| 28 |
grep -v "^@cert-authority \*.${DOMAIN}" /etc/ssh/ssh_known_hosts > /etc/ssh/ssh_known_hosts.tmp |
| 29 |
|
| 30 |
if [ "$(md5sum /etc/ssh/ssh_known_hosts.tmp | cut -d' ' -f1)" = "2a2b4fdd70705b2029b35a24217138e6" ] |
| 31 |
then |
| 32 |
rm -f /etc/ssh/ssh_known_hosts.tmp |
| 33 |
rm -f /etc/ssh/ssh_known_hosts |
| 34 |
|
| 35 |
rmdir /etc/ssh > /dev/null 2>&1 || true |
| 36 |
else |
| 37 |
mv -f /etc/ssh/ssh_known_hosts.tmp /etc/ssh/ssh_known_hosts |
| 38 |
fi |
| 39 |
} |
| 40 |
|
| 41 |
case "${1}" in |
| 42 |
remove) |
| 43 |
# apt |
| 44 |
Remove_apt_sources |
| 45 |
Remove_apt_preferences |
| 46 |
|
| 47 |
# openssh-server |
| 48 |
Remove_ssh_known_hosts |
| 49 |
;; |
| 50 |
|
| 51 |
purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) |
| 52 |
|
| 53 |
;; |
| 54 |
|
| 55 |
*) |
| 56 |
echo "postrm called with unknown argument \`${1}'" >&2 |
| 57 |
exit 1 |
| 58 |
;; |
| 59 |
esac |
| 60 |
|
| 61 |
#DEBHELPER# |
| 62 |
|
| 63 |
exit 0 |