2004-08-18 19:08:08 +02:00
|
|
|
#!/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
|
2005-09-11 01:10:00 +02:00
|
|
|
pw useradd -n netmon -g wheel -c 'Network monitor account' -s /usr/sbin/nologin ;
|
2004-08-18 19:08:08 +02:00
|
|
|
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
|