mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-30 01:15:52 +00:00
8b11366af7
PR: ports/85219 Submitted by: Viktor Fomichev <vfom@narod.ru> (maintainer)
32 lines
598 B
Bash
32 lines
598 B
Bash
#!/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' -s /usr/sbin/nologin ;
|
|
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
|