This file is indexed.

postinst is in fail2ban 0.10.2-2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  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
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#! /bin/sh
# postinst script for fail2ban
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#
preversion=$2

case "$1" in
    configure)
       # To fix the bug in generated by previous version files permissions
       # also closes #352053

       LOG=/var/log/fail2ban.log
       touch $LOG
       chown root:adm ${LOG}*
       chmod 640 ${LOG}*
        
       # Note regarding changed configuration file
       # Note regarding changed configuration file
		if [ ! -z $preversion ]; then
			if dpkg --compare-versions $preversion lt 0.7.1-1; then
			cat <<EOF
WARNING!
  
  Fail2ban 0.7 is a complete rewrite of the 0.6 version, and if you
  customized any of provided configuration or startup files
  (/etc/default/fail2ban, /etc/fail2ban.conf, /etc/init.d/fail2ban), please
  read relevant entry in /usr/share/doc/fail2ban/NEWS.Debian.gz.
  
EOF
			fi
			if dpkg --compare-versions $preversion lt 0.5.4-5.14; then
			cat <<EOF
WARNING!

 Configuration file /etc/fail2ban.conf, failregex configuration
 parameter specificly, were changed in 0.5.4-5 to close reported
 security breach, and in 0.5.4-5.14 to close few other bugs.

updating from <0.5.4-5
 Unless configuration file (or corresponding failregex'es) gets updated,
 security breach is not closed and corresponding warning will be reported
 by the fail2ban (in the log files).

updating from <0.5.4-5.14
 Bugs #329163, #331695 dealing with changed iptables rules
 outside of fail2ban were fixed in 0.5.4-5.14, and require upgrade of the
 configuration file (fwcheck option was introduced) to take full
 advantage of the problem solution (otherwise some problems might
 persist)

 Please review the configuration file and make appropriate changes.
ENJOY!

EOF
			fi
		fi
		;;

    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

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

if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
    dpkg-maintscript-helper mv_conffile /etc/fail2ban/action.d/firewall-cmd-direct-new.conf /etc/fail2ban/action.d/firewallcmd-new.conf 0.8.13-1~ -- "$@"
    dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/lighttpd-fastcgi.conf /etc/fail2ban/filter.d/suhosin.conf 0.8.13-1~ -- "$@"
    dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/sasl.conf /etc/fail2ban/filter.d/postfix-sasl.conf 0.8.13-1~ -- "$@"
    dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/couriersmtp.conf /etc/fail2ban/filter.d/courier-smtp.conf 0.9.0-1~ -- "$@"
    dpkg-maintscript-helper mv_conffile /etc/fail2ban/filter.d/courierlogin.conf /etc/fail2ban/filter.d/courier-auth.conf 0.9.0-1~ -- "$@"
fi

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


# Automatically added by dh_python3:
if which py3compile >/dev/null 2>&1; then
	py3compile -p fail2ban 
fi

# End automatically added section
# Automatically added by dh_systemd_enable/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	# This will only remove masks created by d-s-h on package removal.
	deb-systemd-helper unmask 'fail2ban.service' >/dev/null || true

	# was-enabled defaults to true, so new installations run enable.
	if deb-systemd-helper --quiet was-enabled 'fail2ban.service'; then
		# Enables the unit on first installation, creates new
		# symlinks on upgrades if the unit file has changed.
		deb-systemd-helper enable 'fail2ban.service' >/dev/null || true
	else
		# Update the statefile to add new symlinks (if any), which need to be
		# cleaned up on purge. Also remove old symlinks.
		deb-systemd-helper update-state 'fail2ban.service' >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	# In case this system is running systemd, we need to ensure that all
	# necessary tmpfiles (if any) are created before starting.
	if [ -d /run/systemd/system ] ; then
		systemd-tmpfiles --create /usr/lib/tmpfiles.d/fail2ban-tmpfiles.conf >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if [ -x "/etc/init.d/fail2ban" ]; then
		update-rc.d fail2ban defaults 99 >/dev/null
		invoke-rc.d fail2ban start || exit 1
	fi
fi
# End automatically added section


exit 0