summaryrefslogtreecommitdiff
path: root/community/bip/bip.install
blob: 53ec9ac10c8dd8904a75e0fb776c7685407d817e (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
post_install() {
    if ! getent passwd bip > /dev/null; then
        echo "==> Creating bip user"
        /usr/bin/useradd --comment "Bip IRC Proxy" --shell /bin/sh --home /var/lib/bip --system --user-group bip
    fi
    mkdir -p /var/run/bip 2>/dev/null
    chown -R bip:bip /var/run/bip
    mkdir -p /var/lib/bip 2>/dev/null
    chown -R bip:bip /var/lib/bip
    mkdir -p /var/log/bip 2>/dev/null
    chown -R bip:bip /var/log/bip
}

post_upgrade() {
    post_install
}

pre_remove() {
    systemctl stop bip
    echo "==> Removing bip user and group"
    userdel bip
    if getent group bip > /dev/null; then
        groupdel bip
    fi
    rm -rf /var/run/bip
}