summaryrefslogtreecommitdiff
path: root/debian/openssh-client.postrm
diff options
context:
space:
mode:
Diffstat (limited to 'debian/openssh-client.postrm')
-rw-r--r--debian/openssh-client.postrm34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/openssh-client.postrm b/debian/openssh-client.postrm
new file mode 100644
index 000000000..eb6fde06b
--- /dev/null
+++ b/debian/openssh-client.postrm
@@ -0,0 +1,34 @@
1#!/bin/sh -e
2
3#DEBHELPER#
4
5abort_transfer_conffile () {
6 CONFFILE="$1"
7 if [ -e "$CONFFILE.moved-by-preinst" ]; then
8 echo >&2 "Aborting ownership transfer of conffile $CONFFILE ..."
9 mv -f "$CONFFILE.moved-by-preinst" "$CONFFILE"
10 return 0
11 fi
12}
13
14case $1 in
15 abort-install|abort-upgrade)
16 abort_transfer_conffile /etc/ssh/moduli
17 abort_transfer_conffile /etc/ssh/ssh_config
18 ;;
19 purge)
20 # Remove all non-conffiles that ssh might create, so that we
21 # can smoothly remove /etc/ssh if and only if the user
22 # hasn't dropped some other files in there. Conffiles have
23 # already been removed at this point.
24 rm -f /etc/ssh/moduli /etc/ssh/primes
25 rm -f /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2
26 rmdir --ignore-fail-on-non-empty /etc/ssh
27
28 if which delgroup; then
29 delgroup --quiet ssh > /dev/null || true
30 fi
31 ;;
32esac
33
34exit 0