File: courier-webadmin.postinst

package info (click to toggle)
courier 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 54,444 kB
  • sloc: ansic: 130,619; cpp: 33,255; sh: 10,437; perl: 4,250; makefile: 3,447; sed: 39
file content (33 lines) | stat: -rw-r--r-- 910 bytes parent folder | download
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
#!/bin/sh

# Exit immediately if a command produces an error.
set -e

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

# Create a dpkg-statoverride add function.
add_override() {
    if ! dpkg-statoverride --list $4 >/dev/null 2>&1; then
        dpkg-statoverride --update --add $1 $2 $3 $4
    fi
}

if [ "$1" = "configure" ]; then
    # Add the dpkg-statoverrides.
    add_override courier courier 750 /etc/courier/webadmin
    add_override courier courier 750 /etc/courier/webadmin/added
    # The password is sensitive, so it should only be readable by courier.
    add_override courier courier 600 /etc/courier/webadmin/password
    add_override courier courier 750 /etc/courier/webadmin/removed

    # Store the password for Courier web administration
    db_get courier-webadmin/password
    if [ "$RET" ]; then
        echo $RET > /etc/courier/webadmin/password
    fi
fi

#DEBHELPER#

exit 0