summaryrefslogtreecommitdiff
path: root/debian/postrm
diff options
context:
space:
mode:
Diffstat (limited to 'debian/postrm')
-rw-r--r--debian/postrm30
1 files changed, 30 insertions, 0 deletions
diff --git a/debian/postrm b/debian/postrm
new file mode 100644
index 000000000..73eeeb463
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,30 @@
1#!/bin/sh -e
2
3#DEBHELPER#
4
5if [ "$1" = "purge" ]
6then
7 # Remove all non-conffiles that ssh might create, so that we can
8 # smoothly remove /etc/ssh if and only if the user hasn't dropped some
9 # other files in there. Conffiles have already been removed at this
10 # point.
11 rm -f /etc/ssh/moduli /etc/ssh/primes
12 rm -f /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub
13 rm -f /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_rsa_key.pub
14 rm -f /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_dsa_key.pub
15 rm -f /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2
16 rm -f /etc/ssh/sshd_config
17 rm -f /etc/ssh/sshd_not_to_be_run
18 rmdir --ignore-fail-on-non-empty /etc/ssh
19fi
20
21if [ "$1" = "purge" ] ; then
22 update-rc.d ssh remove >/dev/null
23fi
24
25if [ "$1" = "purge" ] ; then
26 deluser --quiet sshd > /dev/null || true
27 delgroup --quiet ssh > /dev/null || true
28fi
29
30exit 0