1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

Use USERS and GROUPS

This commit is contained in:
Chris Rees 2012-05-30 19:51:31 +00:00
parent dc5bb34822
commit fd80ab59bd
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=297821
3 changed files with 3 additions and 60 deletions

View File

@ -22,6 +22,9 @@ PATCHFILES= ${DISTNAME}.patch${PATCH_VERSION}${EXTRACT_SUFX} ${DISTNAME}.docs${
MAINTAINER= ports@FreeBSD.org
COMMENT= Netmond - IP network monitoring daemon
USERS= netmon
GROUPS= ${USERS}
#MK_IFGRAPH= yes
PATCHDIR= ${WRKDIR}/patches
@ -56,16 +59,6 @@ post-extract:
${CP} ${PATCHDIR}/pipe.c ${WRKSRC}
do-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 ${BINGRP} 2>/dev/null ; then \
${ECHO} "Group '${BINGRP}' exists." ; \
else \
pw groupadd ${BINGRP} -M root,netmon ; \
fi
${INSTALL_PROGRAM} ${WRKSRC}/netmond ${PREFIX}/sbin/netmond
.if defined(MK_IFGRAPH)
${INSTALL_PROGRAM} ${WRKSRC}/ifgraph ${PREFIX}/sbin/ifgraph

View File

@ -1,19 +0,0 @@
#!/bin/sh
#
PKGNAME=$1
#
case $2 in
DEINSTALL)
;;
POST-DEINSTALL)
echo ""
echo "If you wish to remove this port from your computer complete,"
echo "remove user 'netmon' and group 'netmon' manually."
echo ""
;;
*)
echo "Unexpected Argument $2!!!"
exit 1
;;
esac
exit 0

View File

@ -1,31 +0,0 @@
#!/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