summaryrefslogtreecommitdiff
path: root/community/prosody/prosody.install
blob: 354a32ab10d393c6de578014c4c0c0c98a1cb28f (plain)
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
post_install() {
    if [ -z "`grep '^prosody:' /etc/group`" ]; then
        groupadd -g 412 prosody
    fi
    if [ -z "`grep '^prosody:' /etc/passwd`" ]; then
        useradd -u 412 -d /var/lib/prosody -g prosody -s /bin/false prosody
    fi

    chown prosody:prosody var/lib/prosody
    chown prosody:prosody var/log/prosody

cat << EOF

==> Documentation: http://wiki.archlinux.org/index.php/Prosody
==> ChangeLog: pacman -Qc prosody

EOF
}

post_upgrade() {
    post_install $1
}

post_remove() {
    userdel prosody

    paths=(/etc/prosody /var/lib/prosody /var/log/prosody
           /var/log/old/prosody)

    first=true
    for path in ${paths[@]}; do
        if [ -d $path ]; then
            if $first; then
                first=false
                echo "==> Leftover Paths:"
            fi
            echo "==> $path"
        fi
    done
}