1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00
freebsd-ports/misc/dnetc/pkg-install
Pav Lucistnik 10e6e5dae2 - Give maintainership to submitter
- Turn into master slave to allow slaves of different architectures
- Remove user/group on deinstall
- Install rc script as .sample
- Various tweaks

PR:		ports/67463
Submitted by:	Tim Bishop <tim@bishnet.net>
2004-06-02 16:47:02 +00:00

33 lines
855 B
Bash

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