summaryrefslogtreecommitdiff
path: root/debian/conntrackd.preinst
blob: 2bb65ef6368a82cbf7eadd6f8db8f5ef236d77b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
set -e

action=$1
version=$2

if [ "$action" = upgrade -a -n "$version" ] &&
    dpkg --compare-versions "$version" lt "1:0.9.8-1" &&
    test -f /etc/conntrackd.conf &&
    ! test -e /etc/conntrackd/conntrackd.conf; then
    # package versions < 0.9.8-1 had the configuration file in a
    # non-standard location
    mkdir -p /etc/conntrackd
    if md5sum /etc/conntrackd.conf 2> /dev/null |
        grep -q 9e463d9bb7902e513da1b90b326bd43d
    then
        # unmodified version, dpkg should not prompt, delete in postinst
        mv /etc/conntrackd.conf /etc/conntrackd.conf.dpkg-updating
    else
	# move to new location to make dpkg prompt
        mv /etc/conntrackd.conf /etc/conntrackd/conntrackd.conf
    fi
fi

#DEBHELPER#