mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-29 01:13:08 +00:00
7794504fc8
- Correct detection of sendmail port - Don't delete config file if modified - Use special user for setuid programs PR: ports/74158 Submitted by: Dean Hollister <dean@odyssey.apana.org.au> (maintainer)
37 lines
713 B
Bash
37 lines
713 B
Bash
#!/bin/sh
|
|
# $FreeBSD$
|
|
|
|
PREFIX=${PKG_PREFIX:-%%PREFIX%%}
|
|
|
|
DCCUSER=%%DCCUSER%%
|
|
DCCUID=%%DCCUID%%
|
|
DCCGROUP=%%DCCGROUP%%
|
|
DCCGID=%%DCCGID%%
|
|
|
|
if [ "$2" = "PRE-INSTALL" ]; then
|
|
|
|
if ! pw groupshow "$DCCGROUP" 2>/dev/null 1>&2; then
|
|
if pw groupadd $DCCGROUP -g $DCCGID; then
|
|
echo "=> Added group \"$DCCGROUP\"."
|
|
else
|
|
echo "=> Adding group \"$DCCGROUP\" failed..."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if ! pw usershow "$DCCUSER" 2>/dev/null 1>&2; then
|
|
if pw useradd $DCCUSER -u $DCCUID -g $DCCGROUP -h - \
|
|
-s "/sbin/nologin" -d "/nonexistent" \
|
|
-c "Distributed Checksum Clearinghouse"; \
|
|
then
|
|
echo "=> Added user \"$DCCUSER\"."
|
|
else
|
|
echo "=> Adding user \"$DCCUSER\" failed..."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
fi
|
|
|
|
exit 0
|