summaryrefslogtreecommitdiff
path: root/social/spectrum/spectrum.install
blob: 738fc5bbeca86be8414adfd50f61882076aeb23a (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
41
42
43
44
45
46
47
# arg 1:  the new package version
post_install() {
    if [ -z "`grep '^spectrum:' /etc/group`" ]; then
        groupadd -g 417 spectrum
    fi
    if [ -z "`grep '^spectrum:' /etc/passwd`" ]; then
        useradd -u 417 -d /etc/spectrum -g spectrum -s /bin/false spectrum
    fi

    chown spectrum:spectrum var/lib/spectrum
    chown spectrum:spectrum var/log/spectrum
    chown spectrum:spectrum var/run/spectrum

cat << EOF

==> Documentation: http://spectrum.im/

==> You must now customize the configuration file located in /etc/spectrum/.  Copy and reconfigure for each seperate protocol.

EOF

}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
    post_install $1
}

# arg 1: the old package version
post_remove() {
    userdel spectrum

    paths=(/etc/spectrum /var/lib/spectrum /var/log/spectrum
           /var/run/spectrum)
    
    first=true
    for path in ${paths[@]}; do
        if [ -d $path ]; then
            if $first; then
                first=false
                echo "==> Leftover Paths:"
            fi
            echo "==> $path"
        fi
    done
}