aboutsummaryrefslogtreecommitdiff
path: root/net/cvsup-mirror/pkg-install
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>2000-02-11 04:26:59 +0000
committerJohn Polstra <jdp@FreeBSD.org>2000-02-11 04:26:59 +0000
commit7c45758b34406054770a7bb69c9dc850d7897f9d (patch)
tree46cecb9ccef3713c9d97af5c895d437e59881a66 /net/cvsup-mirror/pkg-install
parent5274635be155cba5fbd962d816673c482ab4de09 (diff)
downloadports-7c45758b34406054770a7bb69c9dc850d7897f9d.tar.gz
ports-7c45758b34406054770a7bb69c9dc850d7897f9d.zip
Notes
Diffstat (limited to 'net/cvsup-mirror/pkg-install')
-rw-r--r--net/cvsup-mirror/pkg-install30
1 files changed, 25 insertions, 5 deletions
diff --git a/net/cvsup-mirror/pkg-install b/net/cvsup-mirror/pkg-install
index 84c018fd5d1d..98e6940d3d70 100644
--- a/net/cvsup-mirror/pkg-install
+++ b/net/cvsup-mirror/pkg-install
@@ -73,10 +73,13 @@ EOF
}
make_account() {
- local u g
+ local u g gcos homeopt home
u=$1
g=$2
+ gcos=$3
+ homeopt=${4:+"-d $4"}
+
if pw group show "${g}" >/dev/null 2>&1; then
echo "You already have a group \"${g}\", so I will use it."
else
@@ -99,14 +102,31 @@ make_account() {
else
echo "You need a user \"${u}\"."
if which -s pw && yesno "Would you like me to create it" y; then
- pw useradd ${u} -g ${g} -h - -d /nonexistent \
- -s /nonexistent -c "CVSup Daemon" || exit
+ pw useradd ${u} -g ${g} -h - ${homeopt} \
+ -s /nonexistent -c "${gcos}" || exit
echo "Done."
else
echo "Please create it, and try again."
exit 1
fi
fi
+
+ if [ x"$homeopt" = x ]; then
+ eval home=~${u}
+ if [ ! -d "${home}" ]; then
+ if yesno \
+ "Would you like me to create ${u}'s home directory (${home})" y
+ then
+ (umask 77 && \
+ mkdir -p ${home}/.cvsup && \
+ touch ${home}/.cvsup/auth) || exit
+ chown -R ${u}:${g} ${home} || exit
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ fi
+ fi
}
case $2 in
@@ -132,8 +152,8 @@ EOF
fi
echo ""
- make_account ${user} ${group}
- make_account ${cuser} ${cgroup}
+ make_account ${user} ${group} "CVSup Daemon" "/nonexistent"
+ make_account ${cuser} ${cgroup} "CVSup Client"
echo "Fixing ownerships and modes in \"${base}\"."
chown -R root:wheel ${base}