File: ebtables.postinst

package info (click to toggle)
ebtables 2.0.11-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 2,144 kB
  • sloc: ansic: 9,451; sh: 4,647; makefile: 61; perl: 45
file content (52 lines) | stat: -rw-r--r-- 1,490 bytes parent folder | download | duplicates (3)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
# postinst script for ebtables
#
# see: dh_installdeb(1)

set -e

case "$1" in
    configure)
        if dpkg --compare-versions "$2" le-nl "2.0.10.4-3.2~"; then
            if [ -d /var/lib/ebtables ]; then
                rmdir --ignore-fail-on-non-empty /var/lib/ebtables
            fi
        fi
	if dpkg --compare-versions "$2" le "2.0.10.4+snapshot20181205-2"; then
	    update-rc.d ebtables remove
	    deb-systemd-helper disable ebtables.service
	    deb-systemd-helper purge ebtables.service
	fi
# compat symlinks for /sbin -> /usr/sbin move, to be dropped in buster+1
        LIST="/sbin/ebtables /sbin/ebtables-save /sbin/ebtables-restore"

        for i in $LIST ; do
            if [ ! -e "$i" ] ; then
                ln -sf /usr$i $i
            fi
        done
    ;;
    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# Providing alternatives with lower priority than those provided by iptables >= 1.8

if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
    update-alternatives \
	--install /usr/sbin/ebtables ebtables /usr/sbin/ebtables-legacy 10 \
	--slave /usr/sbin/ebtables-restore ebtables-restore /usr/sbin/ebtables-legacy-restore \
	--slave /usr/sbin/ebtables-save ebtables-save /usr/sbin/ebtables-legacy-save
fi

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0