mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
audio/ventrilo-server now uses USERS and GROUPS
PR: ports/157928 Submitted by: crees (me) Approved by: rene (mentor, implicit), maintainer timeout (20 days)
This commit is contained in:
parent
d92f3197a4
commit
0dbca19780
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=277252
1
GIDs
1
GIDs
@ -77,6 +77,7 @@ ladvd:*:142:
|
||||
dovecot:*:143:
|
||||
dovenull:*:144:
|
||||
webcamd:*:145:
|
||||
ventrilo:*:146:
|
||||
rbldns:*:153:
|
||||
sfs:*:171:
|
||||
agk:*:172:
|
||||
|
1
UIDs
1
UIDs
@ -85,6 +85,7 @@ ladvd:*:142:142::0:0:Ladvd User:/var/empty:/usr/sbin/nologin
|
||||
dovecot:*:143:143::0:0:Dovecot User:/var/empty:/usr/sbin/nologin
|
||||
dovenull:*:144:144::0:0:Dovecot login User:/var/empty:/usr/sbin/nologin
|
||||
webcamd:*:145:145::0:0:Webcamd user:/var/empty:/usr/sbin/nologin
|
||||
ventrilo:*:146:146::0:0:& server:/usr/local/ventrilo-server:/usr/sbin/nologin
|
||||
rbldns:*:153:153::0:0:rbldnsd pseudo-user:/nonexistent:/usr/sbin/nologin
|
||||
sfs:*:171:171::0:0:Self-Certifying File System:/nonexistent:/usr/sbin/nologin
|
||||
agk:*:172:172::0:0:AquaGateKeeper:/nonexistent:/nonexistent
|
||||
|
@ -27,6 +27,8 @@ RESTRICTED= Redistribution of pre-compiled binaries is not permitted
|
||||
INSTALL_DIR= ${PREFIX}/ventrilo-server
|
||||
USE_RC_SUBR= ${PORTNAME}${PKGNAMESUFFIX}.sh
|
||||
VENT_USER= ${PORTNAME}
|
||||
USERS= ${VENT_USER}
|
||||
GROUPS= ${USERS}
|
||||
WRKSRC= ${WRKDIR}/ventsrv
|
||||
SUB_FILES= pkg-message
|
||||
|
||||
@ -35,8 +37,6 @@ IGNORE= distfile can only be fetched if you accept the license. Go to http://www
|
||||
.endif
|
||||
|
||||
do-install:
|
||||
@ ${SETENV} PKG_PREFIX=${PREFIX} \
|
||||
${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
|
||||
@${MKDIR} ${INSTALL_DIR}
|
||||
@${CHOWN} ${VENT_USER} ${INSTALL_DIR}
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/ventrilo_srv ${INSTALL_DIR}
|
||||
@ -54,10 +54,6 @@ do-install:
|
||||
post-install:
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
|
||||
post-deinstall:
|
||||
@ ${SETENV} PKG_PREFIX=${PREFIX} \
|
||||
${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL
|
||||
|
||||
PKGDEINSTALL= ${PKGINSTALL}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
@ -1,67 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
PATH=/bin:/usr/sbin
|
||||
HOMEDIR=${PKG_PREFIX}/ventrilo-server
|
||||
NAME="Ventrilo"
|
||||
|
||||
USER=ventrilo
|
||||
UID=117
|
||||
GROUP=${USER}
|
||||
GID=117
|
||||
|
||||
case $2 in
|
||||
PRE-INSTALL)
|
||||
if pw group show "${GROUP}" 2>/dev/null; then
|
||||
echo "You already have a group \"${GROUP}\", so I will use it."
|
||||
else
|
||||
if pw groupadd ${GROUP} -g ${GID}; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if pw user show "${USER}" 2>/dev/null; then
|
||||
echo "You already have a user \"${USER}\", so I will use it."
|
||||
else
|
||||
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
|
||||
-d ${HOMEDIR} -s /sbin/nologin -c "${NAME} Server"
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! [ -x ~${USER} ] ; then
|
||||
mkdir -p "${HOMEDIR}"
|
||||
chown ${USER}:${GROUP} "${HOMEDIR}"
|
||||
fi
|
||||
;;
|
||||
|
||||
POST-DEINSTALL)
|
||||
if pw group show "${GROUP}" 2>/dev/null; then
|
||||
if pw groupdel ${GROUP}; then
|
||||
echo "Removed group \"${GROUP}\"."
|
||||
else
|
||||
echo "Removing group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Group \"${GROUP}\" doesn't exist!"
|
||||
fi
|
||||
|
||||
if pw user show "${USER}" 2>/dev/null; then
|
||||
if pw userdel ${USER}; then
|
||||
echo "Removed user \"${USER}\"."
|
||||
else
|
||||
echo "Removing user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "User \"${USER}\" doesn't exist!"
|
||||
fi
|
||||
;;
|
||||
esac
|
Loading…
Reference in New Issue
Block a user