This file is indexed.

postinst is in mediatomb-daemon 0.12.1-5ubuntu2.

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

DATADIR=/var/lib/mediatomb


# Copies database file from sqlite3.db to mediatomb.db
mv_db() {
    [ ! -e /var/lib/mediatomb/mediatomb.db ] || return 0
    [ ! -e /var/lib/mediatomb/sqlite3.db ] || \
        cp --preserve /var/lib/mediatomb/sqlite3.db /var/lib/mediatomb/mediatomb.db
}

case "$1" in
configure)
    # stolen from mysql deb package...
    
    # If we use NIS then errors should be tolerated. It's up to the
    # user to ensure that the mediatomb user is correctly setup.
    # Beware that there are two ypwhich one of them needs the 2>/dev/null!
    if test -n "`which ypwhich 2>/dev/null`"  &&  ypwhich >/dev/null 2>&1; then
        set +e
    fi

    # creating mediatomb group if it isn't already there
    if ! getent group mediatomb >/dev/null; then
        # Adding system group: mediatomb.
        addgroup --system mediatomb >/dev/null
    fi
    
    # creating mediatomb user if it isn't already there
    if ! getent passwd mediatomb >/dev/null; then
        # Adding system user: mediatomb.
        adduser \
         --system \
         --ingroup mediatomb \
         --home $DATADIR \
         --gecos "MediaTomb Server" \
         --shell /usr/sbin/nologin \
         --disabled-login \
         --disabled-password \
         mediatomb  >/dev/null
    fi
    
    # end of NIS tolerance zone
    set -e
    
    if ! dpkg-statoverride --list /etc/mediatomb/config.xml >/dev/null 2>&1
    then
    	dpkg-statoverride --update --add mediatomb mediatomb 644 /etc/mediatomb/config.xml
    fi
    if ! dpkg-statoverride --list /var/lib/mediatomb >/dev/null 2>&1
    then
    	dpkg-statoverride --update --add mediatomb mediatomb 755 /var/lib/mediatomb
    fi

    # Force removal of previous scripts if upgrading from 0.11.0-3
    if [ -n "$2" ] && dpkg --compare-versions "$2" le "0.11.0-3"; then
        update-rc.d -f mediatomb remove >/dev/null || exit $?
    fi
    if [ -n "$2" ] && dpkg --compare-versions "$2" le "0.12.0~svn2018-1"; then
        mv_db
    fi
esac

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


exit 0