1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-14 03:10:47 +00:00
freebsd-ports/www/privoxy/pkg-install
Pav Lucistnik 1fa64eae0e - Run privoxy under user 'privoxy'
- Modernize rc script, pkg-message and SHA256 while here

PR:		ports/88602
Submitted by:	aeonflux <aeonflux@aeonflux.no-ip.com>
Approved by:	John Von Essen <john@essenz.com> (maintainer)
2005-11-14 08:37:29 +00:00

34 lines
769 B
Bash

#!/bin/sh
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
PW=/usr/sbin/pw
ECHO=echo
USER=privoxy
GROUP=${USER}
UIDGID=201
if ! ${PW} groupshow "${GROUP}" 2>/dev/null 1>&2; then
if ${PW} groupadd ${GROUP} -g ${UIDGID}; 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} -g ${GROUP} -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-c "privoxy pseudo-user" -u ${UIDGID}; \
then
${ECHO} "Added user \"${USER}\"."
else
${ECHO} "Adding user \"${USER}\" failed..."
exit 1
fi
fi
exit 0