- Use USERS and GROUPS

PR:		ports/157927
Submitted by:	crees
Approved by:	Maintainer, rene (mentor)
This commit is contained in:
Chris Rees 2011-06-17 20:18:55 +00:00
parent cc1ec24ac1
commit 3bfcad91fd
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=275743
2 changed files with 3 additions and 43 deletions

View file

@ -15,6 +15,9 @@ COMMENT= Undernet IRCU irc daemon
CONFLICTS= ircd-hybrid-7.[0-9]*
USERS= undernet
GROUPS= ${USERS}
GNU_CONFIGURE= yes
USE_RC_SUBR= undernet.sh
CONFIGURE_ARGS= --with-dpath=${PREFIX}/etc/ --with-symlink=no
@ -86,9 +89,6 @@ CONFIGURE_ARGS+= --disable-epoll
CONFIGURE_ARGS+= --with-leak-detect
.endif
pre-install:
@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
@${ECHO_MSG} ""
@${ECHO_MSG} " To run undernet ircu you must add 'undernet_enable=\"YES\" to"

View file

@ -1,40 +0,0 @@
#!/bin/sh
if [ "x$2" != "xPRE-INSTALL" ]; then
exit 0;
fi
USER=undernet
GROUP=${USER}
UID=134
GID=${UID}
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."
if pw usermod ${USER} -d "/nonexistant"
then
echo "Changed home directory of \"${USER}\" to \"${NONEXISTENT}\""
else
echo "Changing home directory of \"${USER}\" to \"${NONEXISTENT}\" failed..."
exit 1
fi
else
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-d "/nonexistant" -s "/sbin/nologin" -c "Undernet ircu Daemon"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi