aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/netmond/pkg-install
blob: 4c1773744c6fddeede8ed5e89cb51c9ae0bae264 (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
#!/bin/sh
#
PKGNAME=$1
DATADIR=/var/netmon
#
case $2 in
    PRE-INSTALL)
    if pw user show netmon 2>/dev/null ; then 
        echo "User 'netmon' exists." ; 
    else 
        pw useradd -n netmon -g wheel -c 'Network monitor account' -m ;
    fi
    if pw group show netmon 2>/dev/null ; then 
        echo "Group 'netmon' exists." ;  
    else 
        pw groupadd netmon -M root,netmon ; 
    fi
    if [ ! -d ${DATADIR} ] ; then
        mkdir ${DATADIR}
        chown root:netmon ${DATADIR}
        chmod 750 ${DATADIR}
    fi 
    ;;
    POST-INSTALL)
    ;;
    *)
    echo "Unexpected Argument $2!!!"
    exit 1
    ;;
esac
exit 0