summaryrefslogtreecommitdiff
path: root/mail/smfsav/pkg-install
blob: 90e611687f937a7a01e691ba085ab058fb9307e6 (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
#!/bin/sh

#
# $FreeBSD$
#

PATH=$PATH:/bin:/usr/sbin
export PATH


if [ "$2" = "POST-INSTALL" ]; then

    if grep "^smfsav:" /etc/group > /dev/null; then
	:
	else
	echo "[*] Adding group \"smfsav\""
	pw groupadd -n smfsav -g 666
    fi

    if grep "^smfsav:" /etc/passwd > /dev/null; then
	:
	else
	echo "[*] Adding user \"smfsav\""
	pw useradd -c SMFSAV -g smfsav -n smfsav -d /nonexistent -s /usr/sbin/nologin -u 666
    fi
    
    echo "[*] Creating directory \"/var/run/smfsav\""
    mkdir /var/run/smfsav
    chown smfsav:smfsav /var/run/smfsav
    chmod 700 /var/run/smfsav

fi