1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-05 01:55:52 +00:00
freebsd-ports/misc/dnetc/pkg-install
2001-12-04 07:58:50 +00:00

31 lines
757 B
Bash

#!/bin/sh
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
CLIENTUSER=$3
CLIENTGROUP=$4
if ! pw groupshow "$CLIENTGROUP" 2>/dev/null 1>&2; then
if pw groupadd $CLIENTGROUP; then
echo "=> Added group \"$CLIENTGROUP\"."
else
echo "=> Adding group \"$CLIENTGROUP\" failed..."
exit 1
fi
fi
if ! pw usershow "$CLIENTUSER" 2>/dev/null 1>&2; then
if pw useradd $CLIENTUSER -g $CLIENTGROUP -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-c "distributed.net client and proxy pseudo-user"; \
then
echo "=> Added user \"$CLIENTUSER\"."
else
echo "=> Adding user \"$CLIENTUSER\" failed..."
exit 1
fi
fi
exit 0