File: ebtables.postinst

package info (click to toggle)
ebtables 2.0.11-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,136 kB
  • sloc: ansic: 9,448; sh: 4,639; makefile: 62; perl: 45
file content (42 lines) | stat: -rw-r--r-- 1,254 bytes parent folder | download
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
#!/bin/sh
# postinst script for ebtables
#
# see: dh_installdeb(1)

set -e

if [ "$1" = "configure" ]; then
    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
    # Clean-up the old compat symlinks for /sbin -> /usr/sbin
    LIST="ebtables ebtables-save ebtables-restore"
    for i in $LIST; do
	if [ -h "/sbin/$i" ] && [ $(readlink /sbin/$i) = /usr/sbin/$i ] ; then
	    rm /sbin/$i
	fi
    done
fi

# 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