summarylogtreecommitdiffstats
path: root/i2p.install
blob: 146cac383979e6d9a878ada6c35eafcd4cfe9379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
post_install() {
    getent passwd i2p &>/dev/null || {
        echo -n ">>> Creating i2p user... "
        useradd --system --user-group --home /opt/i2p i2p
        echo "done"
    }
    post_upgrade
}

post_upgrade() {
    systemd-tmpfiles --create i2prouter.conf
    chown -R i2p:i2p /opt/i2p
}

pre_remove() {
    getent passwd i2p &>/dev/null && {
        echo -n ">>> Removing i2p user... "
        userdel i2p
        echo "done"
    }
}