summaryrefslogtreecommitdiff
path: root/debian/bigcouch.postinst
blob: 59f9d86e23602b0d457278bf36a244f21916e1e2 (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
#!/bin/sh -e

case $1 in
    configure)
        if ! getent passwd bigcouch > /dev/null; then
            adduser --system --quiet --home /home/bigcouch \
                --shell /bin/bash --group bigcouch
        fi
        if test "`id -u bigcouch`" -eq 0; then
            echo "The bigcouch administrative user must not be root." >&2
            false
        fi
        if test "`id -g bigcouch`" -eq 0; then
            echo "The bigcouch administrative group must not be root." >&2
            false
        fi
        chown -R bigcouch:bigcouch /opt/bigcouch
        mkdir -p /home/bigcouch
        chown -R bigcouch:bigcouch /home/bigcouch
        chown -R bigcouch:bigcouch /opt/bigcouch
        chown -R root:root /etc/sv/bigcouch
        ln -sf /etc/sv/bigcouch /etc/service/
        ;;
esac

#DEBHELPER#