summaryrefslogtreecommitdiff
path: root/debian/openssh-server.preinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2013-05-22 00:59:33 +0100
committerColin Watson <cjwatson@debian.org>2013-05-22 00:59:33 +0100
commitafd3292952a9f0bb107046785ddcfad446d69b89 (patch)
tree9894061066d4a1804faecd731b2899bbd924b63e /debian/openssh-server.preinst
parent6f4754f269cb99609cc27d358873bcbdb574cfd6 (diff)
Replace old manual conffile handling code with dpkg-maintscript-helper,
via dh_installdeb.
Diffstat (limited to 'debian/openssh-server.preinst')
-rw-r--r--debian/openssh-server.preinst19
1 files changed, 2 insertions, 17 deletions
diff --git a/debian/openssh-server.preinst b/debian/openssh-server.preinst
index 8bb2d6f1a..559693f7b 100644
--- a/debian/openssh-server.preinst
+++ b/debian/openssh-server.preinst
@@ -3,25 +3,8 @@
3action=$1 3action=$1
4version=$2 4version=$2
5 5
6prepare_mv_conffile () {
7 CONFFILE="$1"
8 [ -e "$CONFFILE" ] || return 0
9
10 md5sum="$(md5sum "$CONFFILE" | sed -e 's/ .*//')"
11 old_md5sum="$(dpkg-query -W -f '${Conffiles}\n' openssh-server 2>/dev/null | sed 's/^ *//' | awk '$1 == "'"$CONFFILE"'" { print $2 }')"
12 if [ "$md5sum" = "$old_md5sum" ]; then
13 mv -f "$CONFFILE" "$CONFFILE.dpkg-old"
14 else
15 mv -f "$CONFFILE" "$CONFFILE.moving"
16 fi
17}
18
19if [ "$action" = upgrade ] || [ "$action" = install ] 6if [ "$action" = upgrade ] || [ "$action" = install ]
20then 7then
21 if dpkg --compare-versions "$version" lt 1:4.7p1-4; then
22 prepare_mv_conffile /etc/pam.d/ssh
23 fi
24
25 if dpkg --compare-versions "$version" lt 1:5.5p1-6 && \ 8 if dpkg --compare-versions "$version" lt 1:5.5p1-6 && \
26 [ -d /var/run/sshd ]; then 9 [ -d /var/run/sshd ]; then
27 # make sure /var/run/sshd is not removed on upgrades 10 # make sure /var/run/sshd is not removed on upgrades
@@ -30,3 +13,5 @@ then
30fi 13fi
31 14
32#DEBHELPER# 15#DEBHELPER#
16
17exit 0