This file is indexed.

postinst is in libtowitoko2 2.0.7-9.

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
#!/bin/sh
#
# 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 
#

set -e

cfgdir=/etc/reader.conf.d
cfg=$cfgdir/libtowitoko2
lib=/usr/lib/libtowitoko.so.2.0.0
pcsclite_dir=/usr/lib/pcsc

if [ "$1" = "configure" ]; then

  # Source debconf library.
  . /usr/share/debconf/confmodule

  db_get 'libtowitoko2/port' || true
  SERIAL_PORT="$RET"

  if [ "$RET" != "USB" ]; then

    # First make sure the cfgdir exists
    if [ ! -d $cfgdir ]; then
      mkdir -p $cfgdir
    fi

    echo "FRIENDLYNAME      \"Towitoko Chipdrive Reader\"" > $cfg
    echo "DEVICENAME        /dev/$SERIAL_PORT" >> $cfg
    echo "LIBPATH           $lib" >> $cfg

    case "$SERIAL_PORT" in
      ttyS0)
        echo "CHANNELID         0x0103F8" >> $cfg
        ;;
      ttyS1)
        echo "CHANNELID         0x0102F8" >> $cfg
        ;;
      ttyS2)
        echo "CHANNELID         0x0103E8" >> $cfg
        ;;
      ttyS3)
        echo "CHANNELID         0x0102E8" >> $cfg
        ;;
      *)
        echo "Error: serial port unknown ($SERIAL_PORT)"
        ;;
    esac

    # regenerate /etc/reader.conf if update-reader.conf is available
    if [ -x /usr/sbin/update-reader.conf ]; then
      /usr/sbin/update-reader.conf || true
    fi
  fi

  db_stop

  if [ -x /etc/init.d/pcscd ]; then
    invoke-rc.d pcscd restart 3>/dev/null
  fi
fi

# Automatically added by dh_makeshlibs
if [ "$1" = "configure" ]; then
	ldconfig
fi
# End automatically added section