1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-04 11:23:46 +00:00
Dennis Herrmann 55d9e367b6 - Update to 1.3.108
PR:		ports/135598
Submitted by:	Craig Green <cgreen@sentex.net> (maintainer)
2009-06-15 19:10:40 +00:00

53 lines
1.2 KiB
Bash

#!/bin/sh
# $FreeBSD$
PREFIX=${PKG_PREFIX:-%%PREFIX%%}
DCCUSER=%%DCCUSER%%
DCCUID=%%DCCUID%%
DCCGROUP=%%DCCGROUP%%
DCCGID=%%DCCGID%%
DCCHOME=%%DCCHOME%%
if [ "$2" = "PRE-INSTALL" ]; then
if ! pw groupshow "$DCCGROUP" 2>/dev/null 1>&2; then
if pw groupadd $DCCGROUP -g $DCCGID; then
echo "=> Added group \"$DCCGROUP\"."
else
echo "=> Adding group \"$DCCGROUP\" failed..."
exit 1
fi
fi
if ! pw usershow "$DCCUSER" 2>/dev/null 1>&2; then
if pw useradd $DCCUSER -u $DCCUID -g $DCCGROUP -h - \
-s "/sbin/nologin" -d "$DCCHOME" \
-c "Distributed Checksum Clearinghouse"; \
then
echo "=> Added user \"$DCCUSER\"."
else
echo "=> Adding user \"$DCCUSER\" failed..."
exit 1
fi
fi
elif [ "$2" = "POST-INSTALL" ]; then
echo "=> Generating unique passwords for your DCC install..."
echo "=>"
echo "=> Note this will make map.sample, map.txt.sample and"
echo "=> ids.sample fail their MD5 checks on package removal."
/bin/sh $PREFIX/dcc/libexec/fix-map \
-n .sample \
-I $DCCHOME/ids.sample -i $DCCHOME/ids \
-T $DCCHOME/map.txt.sample -t $DCCHOME/map.txt \
-m $DCCHOME/map
for file in ids map map.txt ; do
/bin/cp -p $DCCHOME/$file $DCCHOME/${file}.sample
done
fi
exit 0