summaryrefslogtreecommitdiffstats
path: root/debian/progress-linux.postrm
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-20 15:31:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-20 15:31:14 +0000
commitebc1246b226309918d57d79d6de6d05b59720704 (patch)
treef161e3f8045d1e6bf2244ec8b26fac578fdf9fd2 /debian/progress-linux.postrm
parentAdding upstream version 20240420. (diff)
downloadprogress-linux-ebc1246b226309918d57d79d6de6d05b59720704.tar.xz
progress-linux-ebc1246b226309918d57d79d6de6d05b59720704.zip
Adding debian version 20240420-1.debian/20240420-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/progress-linux.postrm')
-rwxr-xr-xdebian/progress-linux.postrm63
1 files changed, 63 insertions, 0 deletions
diff --git a/debian/progress-linux.postrm b/debian/progress-linux.postrm
new file mode 100755
index 0000000..38f85e8
--- /dev/null
+++ b/debian/progress-linux.postrm
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+set -e
+
+PROJECT="progress-linux"
+DOMAIN="progress-linux.org"
+
+Remove_apt_sources ()
+{
+ # apt sources
+ rm -f "/etc/apt/sources.list.d/${PROJECT}.list"
+}
+
+Remove_apt_preferences ()
+{
+ # apt preferences
+ rm -f "/etc/apt/preferences.d/${PROJECT}.pref"
+}
+
+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
+ remove)
+ # apt
+ Remove_apt_sources
+ Remove_apt_preferences
+
+ # openssh-server
+ Remove_ssh_known_hosts
+ ;;
+
+ purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0