diff options
author | veego <veego@pkgsrc.org> | 2000-09-03 12:03:16 +0000 |
---|---|---|
committer | veego <veego@pkgsrc.org> | 2000-09-03 12:03:16 +0000 |
commit | 5cfab8de8b8537e3b253099a7d5b3b7de608e37c (patch) | |
tree | cc219991536ba5474ded260b674dad8476112ff3 | |
parent | c3bad2d4a251f853302e47872dad97c0f53dc191 (diff) | |
download | pkgsrc-5cfab8de8b8537e3b253099a7d5b3b7de608e37c.tar.gz |
Fix the install script so it also works with NIS.
Based on the cyrus-imapd changes.
-rw-r--r-- | sysutils/amanda-common/Makefile | 6 | ||||
-rw-r--r-- | sysutils/amanda-common/pkg/INSTALL | 22 |
2 files changed, 18 insertions, 10 deletions
diff --git a/sysutils/amanda-common/Makefile b/sysutils/amanda-common/Makefile index 8a2a74728c3..12ec248e02f 100644 --- a/sysutils/amanda-common/Makefile +++ b/sysutils/amanda-common/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2000/08/17 02:26:28 wiz Exp $ +# $NetBSD: Makefile,v 1.11 2000/09/03 12:03:16 veego Exp $ # FreeBSD Id: Makefile,v 1.9 1997/03/08 05:00:11 gpalmer Exp # @@ -44,6 +44,10 @@ pre-install: -e 's|@AMGROUP@|${AMANDA_GROUP}|g' \ -e 's|@ADDUSER@|${ADDUSER}|g' \ -e 's|@ADDGROUP@|${ADDGROUP}|g' \ + -e 's|@CHGRP@|${CHGRP}|g' \ + -e 's|@ID@|${ID}|g' \ + -e 's|@TOUCH@|${TOUCH}|g' \ + -e 's|@RM@|${RM}|g' \ < ${PKGDIR}/INSTALL > ${INSTALL_FILE} PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL diff --git a/sysutils/amanda-common/pkg/INSTALL b/sysutils/amanda-common/pkg/INSTALL index 29c238aba54..c8116845627 100644 --- a/sysutils/amanda-common/pkg/INSTALL +++ b/sysutils/amanda-common/pkg/INSTALL @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: INSTALL,v 1.2 2000/08/17 02:40:45 hubertf Exp $ +# $NetBSD: INSTALL,v 1.3 2000/09/03 12:03:17 veego Exp $ PKGNAME=$1 STAGE=$2 @@ -9,30 +9,34 @@ AMUSER=@AMUSER@ AMGROUP=@AMGROUP@ ADDUSER=@ADDUSER@ ADDGROUP=@ADDGROUP@ +CHGRP=@CHGRP@ +ID=@ID@ +TOUCH=@TOUCH@ +RM=@RM@ case ${STAGE} in PRE-INSTALL) # Group... the default's shipped with NetBSD # We need to check that ${AMGROUP} exists before adding the user. # - if grep -q "^${AMGROUP}:" /etc/group - then + ${TOUCH} "/tmp/grouptestamanda.$$" + ${CHGRP} ${AMGROUP} "/tmp/grouptestamanda.$$" >/dev/null 2>&1 + if [ $? -eq 0 ]; then echo "Group '${AMGROUP}' already exists...proceeding." else echo "Creating '${AMGROUP}' group..." ${ADDGROUP} ${AMGROUP} echo "Done." fi + ${RM} -f "/tmp/grouptestamanda.$$" - # use finger to be able to use NIS, ... - # - if finger ${AMUSER} 2>&1 | grep >/dev/null "no such user" - then + ${ID} ${AMUSER} >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "User '${AMUSER}' already exists...proceeding." + else echo "Creating '${AMUSER}' user..." ${ADDUSER} -c "Amanda User" -g ${AMGROUP} -s /bin/sh ${AMUSER} echo "Done." - else - echo "User '${AMUSER}' already exists...proceeding." fi ;; POST-INSTALL) |