This file is indexed.

postinst is in squid-deb-proxy 0.6.3.

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
138
139
#!/bin/sh
# postinst script for squid-deb-proxy
#
# 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>
#        * <postinst> `abort-remove'
#        * <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

# A simplified version of debconf's own config script.
. /usr/share/debconf/confmodule

USER_NETWORKS=/etc/squid-deb-proxy/allowed-networks-src.acl.d/10-default
USER_ALLOWED_DESTINATIONS=/etc/squid-deb-proxy/mirror-dstdomain.acl.d/10-default

DEBCONF_NETWORKS=/etc/squid-deb-proxy/allowed-networks-src.acl.d/30-debconf
DEBCONF_ALLOWED_DESTINATIONS=/etc/squid-deb-proxy/mirror-dstdomain.acl.d/30-debconf

case "$1" in
    configure)

        # the users allowed networks, this is not a conffile so its created
        # here
        if [ ! -f "$USER_NETWORKS" ]; then
            cat > "$USER_NETWORKS" <<EOF
# $USER_NETWORKS
# 
# additional network sources that you want to allow access to the cache

# example net
#136.199.8.0/24
EOF
        fi

        # the users allowed destinations, this is not a conffile 
        if [ ! -f "$USER_ALLOWED_DESTINATIONS" ]; then
            cat > "$USER_ALLOWED_DESTINATIONS" <<EOF
# $USER_ALLOWED_DESTINATIONS
# 
# network destinations that are allowed by this cache

# launchpad personal package archives (disabled by default)
#ppa.launchpad.net

# add additional mirror domains here (disabled by default)
#linux.dropbox.com
#download.virtualbox.org
#archive.getdeb.net
#packages.medibuntu.org
#dl.google.com
EOF
        fi

        # pkg blacklist, not a conffile
        PKG_BLACKLIST_IN=/etc/squid-deb-proxy/pkg-blacklist.d/10-default
        cat > $PKG_BLACKLIST_IN <<EOF
# $PKG_BLACKLIST_IN
#
# packages that should be not allowed for download, one binary packagename
# per line
#
#skype
EOF

        # get the debconf answers
        db_get squid-deb-proxy/ppa-enable
        case "$RET" in
            false)
                rm -f "$DEBCONF_ALLOWED_DESTINATIONS"
                ;;
            true)
                cat > "$DEBCONF_ALLOWED_DESTINATIONS" <<EOF
# automatically added by debconf, please use: 
#   sudo dpkg-reconfigure -plow squid-deb-proxy
# to change
ppa.launchpad.net
EOF
                ;;
            *)
                echo "db_get returned unexpected result: '$RET' for squid-deb-proxy/ppa-enable"
                exit 1
                ;;
        esac
        
        db_get squid-deb-proxy/acl-disable
        case "$RET" in
            false)
                rm -f "$DEBCONF_NETWORKS"
                ;;
            true)
                cat > "$DEBCONF_NETWORKS" <<EOF
# automatically added by debconf, please use: 
#   sudo dpkg-reconfigure -plow squid-deb-proxy
# to change
0.0.0.0/0.0.0.0
EOF
                ;;
            *)
                echo "db_get returned unexpected result: '$RET' for squid-deb-proxy/acl-disable"
                exit 1
                ;;
        esac

        invoke-rc.d squid-deb-proxy restart || true
    ;;

    abort-upgrade|abort-remove|abort-deconfigure|triggered)
    ;;

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

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

# Automatically added by dh_installinit
if [ -e "/etc/init/squid-deb-proxy.conf" ]; then
	invoke-rc.d squid-deb-proxy start || exit $?
fi
# End automatically added section
# Automatically added by dh_installinit
update-rc.d -f squid-deb-proxy remove >/dev/null || exit $?
# End automatically added section


exit 0