convert to USERS/GROUPS
Feature safe: yes
This commit is contained in:
parent
e772ec271d
commit
8f5f3b5350
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=241660
2 changed files with 4 additions and 36 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= openntpd
|
||||
PORTVERSION= 4.4
|
||||
PORTREVISION= 1
|
||||
PORTEPOCH= 2
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= ${MASTER_SITE_OPENBSD}
|
||||
|
@ -16,6 +17,9 @@ EXTRACT_SUFX= .tgz
|
|||
MAINTAINER= naddy@FreeBSD.org
|
||||
COMMENT= OpenBSD's Network Time Protocol daemon
|
||||
|
||||
USERS= _ntp
|
||||
GROUPS= _ntp
|
||||
|
||||
USE_RC_SUBR= openntpd
|
||||
|
||||
WRKSRC= ${WRKDIR}/ntpd
|
||||
|
@ -41,7 +45,6 @@ pre-build:
|
|||
${WRKSRC}/ntpd.h ${WRKSRC}/ntpd.conf.5 ${WRKSRC}/ntpd.8
|
||||
|
||||
do-install:
|
||||
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/ntpd ${PREFIX}/sbin
|
||||
${INSTALL_MAN} ${WRKSRC}/ntpd.conf.5 ${PREFIX}/man/man5
|
||||
${INSTALL_MAN} ${WRKSRC}/ntpd.8 ${PREFIX}/man/man8
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
if [ "$2" != "PRE-INSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
USER=_ntp
|
||||
GROUP=${USER}
|
||||
UID=123
|
||||
GID=${UID}
|
||||
|
||||
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
|
||||
if pw groupadd ${GROUP} -g ${GID}; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
|
||||
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
|
||||
-s "/sbin/nologin" -d "/var/empty" \
|
||||
-c "NTP daemon"; \
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Reference in a new issue