mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 09:49:18 -04:00
Use USERS and GROUPS
This commit is contained in:
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
|
@ -22,6 +22,9 @@ PATCHFILES= ${DISTNAME}.patch${PATCH_VERSION}${EXTRACT_SUFX} ${DISTNAME}.docs${
|
||||||
MAINTAINER= ports@FreeBSD.org
|
MAINTAINER= ports@FreeBSD.org
|
||||||
COMMENT= Netmond - IP network monitoring daemon
|
COMMENT= Netmond - IP network monitoring daemon
|
||||||
|
|
||||||
|
USERS= netmon
|
||||||
|
GROUPS= ${USERS}
|
||||||
|
|
||||||
#MK_IFGRAPH= yes
|
#MK_IFGRAPH= yes
|
||||||
PATCHDIR= ${WRKDIR}/patches
|
PATCHDIR= ${WRKDIR}/patches
|
||||||
|
|
||||||
|
@ -56,16 +59,6 @@ post-extract:
|
||||||
${CP} ${PATCHDIR}/pipe.c ${WRKSRC}
|
${CP} ${PATCHDIR}/pipe.c ${WRKSRC}
|
||||||
|
|
||||||
do-install:
|
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
|
${INSTALL_PROGRAM} ${WRKSRC}/netmond ${PREFIX}/sbin/netmond
|
||||||
.if defined(MK_IFGRAPH)
|
.if defined(MK_IFGRAPH)
|
||||||
${INSTALL_PROGRAM} ${WRKSRC}/ifgraph ${PREFIX}/sbin/ifgraph
|
${INSTALL_PROGRAM} ${WRKSRC}/ifgraph ${PREFIX}/sbin/ifgraph
|
||||||
|
|
|
@ -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
|
|
|
@ -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
|
|
Loading…
Add table
Reference in a new issue