This file is indexed.

postinst is in ircd-hybrid 1:8.2.12+dfsg.1-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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh

set -e

. /usr/share/debconf/confmodule

# Automatically added by dh_installinit, edited for use with debconf
# Not added anymore due to dh_installinit -n, so we manage it manually.
if [ -x "/etc/init.d/ircd-hybrid" ]; then
    update-rc.d ircd-hybrid defaults >/dev/null

    if [ "$1" = "configure" ]; then
	if dpkg --compare-versions "$2" le "1:7.2.2-1"; then
	    RET="true"
	else
	    if [ -e /usr/share/debconf/confmodule ]; then
		. /usr/share/debconf/confmodule
		db_get ircd-hybrid/restart_on_upgrade
	    else
		RET="true"
	    fi
	fi
    fi
fi
# End automatically added section

if [ "$1" = configure ]; then



# These directories may have been created before, but we need to make them
# owned by irc. Or the initscript will get owned. If it's already this 
# way, this operation makes no difference.
# As of 1:8.2.8+dfsg.1-1 /var/lib/ircd-hybrid is created
# and /etc/ircd-hybrid becomes root-owned
    mkdir -p /var/lib/ircd-hybrid
    chown irc:irc /var/log/ircd /var/lib/ircd-hybrid
    chown root:irc /etc/ircd-hybrid
    chmod 750 /etc/ircd-hybrid
    chmod 770 /var/lib/ircd-hybrid
    chown root:irc /etc/ircd-hybrid/ircd.conf
    chmod 640 /etc/ircd-hybrid/ircd.conf

    if [ "$RET" = "true" ]; then
        invoke-rc.d ircd-hybrid stop || exit $?
        if ls /etc/ircd-hybrid/*.db /etc/ircd-hybrid/links.txt > /dev/null 2>&1; then
            sleep 3
            if invoke-rc.d ircd-hybrid status > /dev/null 2>&1; then
                echo "ircd-hybrid is still running, so I can't automatically"
                echo "migrate files to /var/lib/ircd-hybrid. You should fix"
                echo "this up manually."
                exit 1
            else
                for file in /etc/ircd-hybrid/*.db /etc/ircd-hybrid/links.txt; do
                    cp -p $file /var/lib/ircd-hybrid;
                    mv $file $file.bak
                done
                echo "I have migrated data files from /etc/ircd-hybrid to /var/lib/ircd-hybrid"
                echo "If you are happy that everything is okay, you can delete the backups in /etc/ircd-hybrid"
            fi
        fi
        invoke-rc.d ircd-hybrid start || exit $?
    else
        echo "I have not stopped or restarted the ircd-hybrid daemon."
        echo "You should do this yourself whenever you're ready."
        if ls /etc/ircd-hybrid/*.db /etc/ircd-hybrid/links.txt > /dev/null 2>&1; then
            echo "Type \`\`invoke-rc.d ircd-hybrid stop, then move the following"
            echo "files to /var/lib/ircd-hybrid:"
            echo /etc/ircd-hybrid/*.db /etc/ircd-hybrid/links.txt
            echo "Then type \`\`invoke-rc.d ircd-hybrid start"
        else
	        echo "Type \`\`invoke-rc.d ircd-hybrid restart''."
        fi
    fi
fi

# Reset this question in case the user installs the SSL version and then
# tries the non-SSL version again
db_fset ircd-hybrid/upgrade_to_nossl_warn seen false