summarylogtreecommitdiffstats
path: root/anope.install
blob: 1ff73f372f6268937d9f9d27f6604b5d21d30fac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
post_install() {
    # Add anope user and group if they don't exist
    getent group anope &>/dev/null || groupadd -r anope >/dev/null
    getent passwd anope &>/dev/null || useradd -r -g anope -d /var/lib/anope -s /bin/false -c anope anope >/dev/null

    # Make sure log directory is writable by the anope user
    chown anope:anope /var/log/anope

    echo "To configure anope, copy /etc/anope/example.conf to"
    echo "/etc/anope/services.conf and edit it to your liking."
    echo
    echo "The systemd service uses a value of /run/anope/anope.pid"
    echo "by default. When editing your services.conf file, be"
    echo "sure to set the location of the PID file to this value."
}

post_remove() {
    # Delete the anope user and group
    # This might fail if anope is running. Need to check this.
    getent passwd anope &>/dev/null && userdel anope >/dev/null
    getent group anope &>/dev/null && groupdel anope >/dev/null
}