2001-12-04 02:43:20 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "$2" != "PRE-INSTALL" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2004-06-02 18:47:02 +02:00
|
|
|
CLIENTUSER=%%CLIENTUSER%%
|
|
|
|
CLIENTGROUP=%%CLIENTGROUP%%
|
|
|
|
UID=%%CLIENTUID%%
|
2004-05-30 09:39:54 +02:00
|
|
|
GID=$UID
|
2001-12-04 02:43:20 +01:00
|
|
|
|
2004-06-02 18:47:02 +02:00
|
|
|
if ! /usr/sbin/pw groupshow "$CLIENTGROUP" 2>/dev/null 1>&2; then
|
|
|
|
if /usr/sbin/pw groupadd $CLIENTGROUP -g $GID; then
|
2001-12-04 02:43:20 +01:00
|
|
|
echo "=> Added group \"$CLIENTGROUP\"."
|
|
|
|
else
|
|
|
|
echo "=> Adding group \"$CLIENTGROUP\" failed..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2004-06-02 18:47:02 +02:00
|
|
|
if ! /usr/sbin/pw usershow "$CLIENTUSER" 2>/dev/null 1>&2; then
|
|
|
|
if /usr/sbin/pw useradd $CLIENTUSER -u $UID -g $CLIENTGROUP -h - \
|
2001-12-04 02:43:20 +01:00
|
|
|
-s "/sbin/nologin" -d "/nonexistent" \
|
2004-06-02 18:47:02 +02:00
|
|
|
-c "distributed.net client pseudo-user"; \
|
2001-12-04 02:43:20 +01:00
|
|
|
then
|
|
|
|
echo "=> Added user \"$CLIENTUSER\"."
|
|
|
|
else
|
|
|
|
echo "=> Adding user \"$CLIENTUSER\" failed..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
exit 0
|