This file is indexed.

postinst is in ipppd 1:3.25+dfsg1-3.7ubuntu1.

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
#! /bin/sh
# postinst script for ipppd

set -e

. /usr/share/debconf/confmodule

# 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>

tempfile=$(mktemp -t isdnutils.XXXXXX)
trap 'rm -f "$tempfile"' EXIT

case "$1" in
    configure)
	old_pwd="$(pwd)"
	if [ ! -c /dev/ttyI0 ]; then
		cd /dev
		echo "Note: running MAKEDEV to create ISDN devices in /dev..."
		WRITE_ON_UDEV=1 /sbin/MAKEDEV isdn-tty isdn-io isdn-ippp
	fi
	# FIXME BUG! MAKEDEV should create the link by itself
	if [ ! -d /dev/.udev/ ] && [ ! -d /run/udev ] ; then
	    # "funny" quoting to avoid Lintian trigger maintainer-script-removes-device-files
	    "rm" -f /dev/isdnctrl
	    ln -s isdnctrl0 /dev/isdnctrl
	fi
	if [ -L /isdnctrl ]; then
	    # Cleanup possibly misplaced symlink created by 1:3.25+dfsg1-3+nmu2
	    rm /isdnctrl
	fi
	cd "$old_pwd"
        forcerestart=false
        RET=ippp0
        db_get ipppd/whichif || true
        case "x$RET" in
            x|xnone|xmanual)
                IPPPX=none
                ;;
            xippp[0-9]|xippp[1-5][0-9]|xippp6[0-3])
                IPPPX=$RET
                ;;
            *)
                IPPPX=ippp0
                ;;
        esac
        if [ "$IPPPX" != none -a ! -s /etc/isdn/device.$IPPPX -a ! -s /etc/isdn/ipppd.$IPPPX ]; then
            db_get ipppd/ispphone || true; ISPPHONE="$RET"
            if [ "$ISPPHONE" != '' -a "$ISPPHONE" != manual ]; then
                db_get ipppd/eaz       || true; EAZ="$RET"
                db_get ipppd/isplogin  || true; ISPLOGIN="$RET"
                db_get ipppd/isppasswd || true; ISPPASSWD=$(echo "$RET" | sed 's,",\\&,g')
                # escape any @ in the username, as perl wants to expand that as an arrary
                ISPLOGIN=$(echo $ISPLOGIN | sed 's,@,\\@,')

                cp /usr/share/isdn/default/device.DEVICE "$tempfile"
                perl -i -pe '$_ = "" if /^# REMOVE the/; $_ = "" if /^echo "Warning!/; $_ = "" if /^LEADINGZERO=0/; s,^LOCALMSN=\d+,LOCALMSN='"'$EAZ'"',; s,^REMOTEMSN=\d+,REMOTEMSN='"'$ISPPHONE'"',; s, out \$LEADINGZERO\$MSN, out \$MSN,;' "$tempfile"
                ucf --three-way --debconf-ok "$tempfile" /etc/isdn/device.$IPPPX
                ucfr ipppd /etc/isdn/device.$IPPPX

                cp /usr/share/isdn/default/ipppd.DEVICE "$tempfile"
                perl -i -pe '$_ = "" if /^# REMOVE the/; $_ = "" if /^# Warning! not configured yet!/; s,^name X.,name '"$ISPLOGIN"',; s,^#ms-get-dns,ms-get-dns,;' "$tempfile"
                ucf --three-way --debconf-ok "$tempfile" /etc/isdn/ipppd.$IPPPX
                ucfr ipppd /etc/isdn/ipppd.$IPPPX

                perl -i -pe "s,^\"?$ISPLOGIN\s,#\$&," /etc/ppp/pap-secrets /etc/ppp/chap-secrets
                echo "# Added by automatic ipppd configuration" >> /etc/ppp/pap-secrets
                echo "# Added by automatic ipppd configuration" >> /etc/ppp/chap-secrets
                printf "\"$ISPLOGIN\"\t\"*\"\t\"$ISPPASSWD\"\n"     >> /etc/ppp/pap-secrets
                printf "\"$ISPLOGIN\"\t\"*\"\t\"$ISPPASSWD\"\n"     >> /etc/ppp/chap-secrets
                forcerestart=true
            fi
        fi

        if [ -s /etc/init.d/isdnutils-base ]; then
            err=false
            if $forcerestart; then
                invoke-rc.d isdnutils-base restart || err=true
            else
                invoke-rc.d isdnutils-base reload ipppd || err=true
            fi
            if $err; then
                db_input high ipppd/isdnutilsinitbad || true
                db_go
            fi
        else
            db_input high ipppd/noisdnutilsinit || true
            db_go
        fi
        ;;

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

    ;;

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

db_stop # grrrr

# Automatically added by dh_installdeb
dpkg-maintscript-helper mv_conffile /etc/ppp/ip-down.d/99-ipppd /etc/ppp/ip-down.d/ipppd 1:3.25+dfsg1-3.3 -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper mv_conffile /etc/ppp/ip-up.d/00-ipppd /etc/ppp/ip-up.d/ipppd 1:3.25+dfsg1-3.3 -- "$@"
# End automatically added section


exit 0