1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00
freebsd-ports/net-mgmt/flowd/pkg-install
Pav Lucistnik 937b77e48d - Update to 0.8.5
PR:		ports/81829
Submitted by:	Janos Mohacsi <janos.mohacsi@bsd.hu> (maintainer)
2005-06-04 00:43:20 +00:00

43 lines
753 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# Based on cyrus-sasl2 port
#
# create 'flowd' user
#
create_user() {
USER=${FLOWD_USER}
GROUP=nobody
PW=/usr/sbin/pw
if [ -x /usr/sbin/nologin ]; then
shell=/usr/sbin/nologin
elif [ -x /sbin/nologin ]; then
shell=/sbin/nologin
else
shell=/nonexistent
fi
uhome="/var/empty"
if ! ${PW} show user ${USER} -q >/dev/null; then
if ! ${PW} add user ${USER} -g ${GROUP} -d "${uhome}" \
-c "flowd privilege separation user" -s "${shell}" -p "*" \
; then
e=$?
echo "*** Failed to add user \`${USER}'. Please add it manually."
exit ${e}
fi
echo "*** Added user \`${USER}' (id ${uid})"
else
echo "*** You already have user \`${USER}'."
fi
}
case $2 in
POST-INSTALL)
create_user
;;
esac