This file is indexed.

postinst is in orthanc 1.2.0+dfsg-1.

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

set -e

case $1 in
    configure)
        # Add the "orthanc" user
        if ! getent passwd orthanc > /dev/null; then
            adduser --system --quiet \
                    --home /var/lib/orthanc --no-create-home \
                    --shell /bin/bash --group --gecos "Orthanc Administrator" orthanc
        fi
        if test "`id -u orthanc`" -eq 0; then
            echo "The orthanc administrative user must not be root." >&2
            false
        fi
        if test "`id -g orthanc`" -eq 0; then
            echo "The orthanc administrative group must not be root." >&2
            false
        fi

        # Configure the permissions of the required directories
        chown -R orthanc:orthanc /etc/orthanc
        chown -R orthanc:orthanc /var/lib/orthanc

        chmod 0775 /etc/orthanc
        chmod 0664 /etc/orthanc/orthanc.json
        chmod 0664 /etc/orthanc/serve-folders.json
	chmod 0775 /var/lib/orthanc

	# Start the Orthanc service after installation
        # https://www.debian.org/doc/debian-policy/ch-opersys.html#s9.3.3.2
	if [ -x /etc/init.d/orthanc ]; then
           if which invoke-rc.d >/dev/null 2>&1; then
               invoke-rc.d orthanc start
           else
               /etc/init.d/orthanc start
           fi
        fi
	;;

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

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

# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/orthanc" ]; then
		update-rc.d orthanc defaults >/dev/null
		if [ -n "$2" ]; then
			_dh_action=restart
		else
			_dh_action=start
		fi
		invoke-rc.d orthanc $_dh_action || exit $?
	fi
fi
# End automatically added section