aboutsummaryrefslogtreecommitdiffstats
path: root/mail/popa3d/pkg-install
blob: 7f90da8375207d102173a90a1b19881a8a162c2c (plain) (blame)
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
#!/bin/sh 

USER=popa3d
UID=89
GID=89
GROUP=popa3d
GECOS="popa3d"
HOME=/nonexistent
SHELL=/sbin/nologin

case $2 in
    PRE-INSTALL)
    which -s pw || {
        cat << EOF

I see that it is missing the "pw" utility. I need this utility.
Please get it and install it, and try again.

EOF
        exit 1
    }
    pw groupshow $GROUP > /dev/null 2>&1 || {
        pw groupadd $GROUP -g $GID;
    }

    pw usershow $USER > /dev/null 2>&1 || {
        pw useradd $USER -g $GROUP -u $UID -h - -d $HOME -s $SHELL -c "$GECOS";
    }

    ;;
    POST-INSTALL)

    ;;
    *)
    echo "usage: $0 <pkg-name> {PRE-INSTALL|POST-INSTALL}"
    exit 64
esac

exit 0