summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorveego <veego>2001-08-12 19:55:56 +0000
committerveego <veego>2001-08-12 19:55:56 +0000
commit0131635a045c22447b18cbc0c6b23b31f8e30a09 (patch)
tree8a80fc1a77c2a4fa8e361c3097efc2b0979d3c0b
parentc43f0e2ef323edcb11743e46348c1552da3cbbd7 (diff)
downloadpkgsrc-0131635a045c22447b18cbc0c6b23b31f8e30a09.tar.gz
Fix same problems with the user check:
- use 'id' instead of 'finger'. this is not a real problem, but it is enough and fixing the next problem makes it possible to use it. - grep -q doesn't work on solaris, so use a different way to suppress the output from the user check. - the return code check for the user was reversed.
-rw-r--r--chat/gale/pkg/INSTALL10
-rw-r--r--databases/postgresql-server/pkg/INSTALL10
-rw-r--r--print/cups/pkg/INSTALL10
-rw-r--r--sysutils/ups-nut/pkg/INSTALL10
4 files changed, 20 insertions, 20 deletions
diff --git a/chat/gale/pkg/INSTALL b/chat/gale/pkg/INSTALL
index d9ad54eaf9b..e07a53bc553 100644
--- a/chat/gale/pkg/INSTALL
+++ b/chat/gale/pkg/INSTALL
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: INSTALL,v 1.2 2001/02/08 23:13:16 lukem Exp $
+# $NetBSD: INSTALL,v 1.3 2001/08/12 19:55:56 veego Exp $
USER=@GALE_USER@
GROUP=@GALE_GROUP@
@@ -28,18 +28,18 @@ else
fi
${RM} -f "/tmp/grouptest.$$"
-# Use `finger' to be able to use NIS.
+# Use `id' to be able to use NIS.
#
-finger ${USER} 2>&1 | ${GREP} -q "no such user"
+id ${USER} 2>/dev/null >/dev/null
if [ $? -eq 0 ]
then
+ echo "User '${USER}' already exists...proceeding."
+else
echo "Creating '${USER}' user..."
${ADDUSER} \
-c "Gale instant messaging system" \
-d /var/${USER} \
-g ${GROUP} -s /bin/sh -m ${USER}
echo "Done."
-else
- echo "User '${USER}' already exists...proceeding."
fi
exit 0
diff --git a/databases/postgresql-server/pkg/INSTALL b/databases/postgresql-server/pkg/INSTALL
index 69999e38152..8762131b5f2 100644
--- a/databases/postgresql-server/pkg/INSTALL
+++ b/databases/postgresql-server/pkg/INSTALL
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: INSTALL,v 1.3 2001/05/18 06:13:55 jlam Exp $
+# $NetBSD: INSTALL,v 1.4 2001/08/12 19:55:56 veego Exp $
PKGNAME=$1
STAGE=$2
@@ -37,11 +37,13 @@ PRE-INSTALL)
fi
${RM} -f "/tmp/grouptest.$$"
- # Use `finger' to be able to use NIS.
+ # Use `id' to be able to use NIS.
#
- finger ${USER} 2>&1 | ${GREP} -q "no such user"
+ id ${USER} 2>/dev/null >/dev/null
if [ $? -eq 0 ]
then
+ echo "User '${USER}' already exists...proceeding."
+ else
echo "Creating '${USER}' user..."
${ADDUSER} \
-c "PostgreSQL database administrator" \
@@ -51,8 +53,6 @@ PRE-INSTALL)
${USER}
${RM} -f ${PGHOME}/.profile
echo "Done."
- else
- echo "User '${USER}' already exists...proceeding."
fi
${MKDIR} ${PGHOME}
${CHOWN} -R ${USER}:${GROUP} ${PGHOME}
diff --git a/print/cups/pkg/INSTALL b/print/cups/pkg/INSTALL
index 6c23fc07ab1..b7cc673ed55 100644
--- a/print/cups/pkg/INSTALL
+++ b/print/cups/pkg/INSTALL
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# $NetBSD: INSTALL,v 1.9 2001/08/02 03:37:40 jlam Exp $
+# $NetBSD: INSTALL,v 1.10 2001/08/12 19:55:56 veego Exp $
PKGNAME=$1
STAGE=$2
@@ -45,16 +45,16 @@ PRE-INSTALL)
fi
${RM} -f "/tmp/grouptest.$$"
- # Use `finger' to be able to use NIS.
+ # Use `id' to be able to use NIS.
#
- finger ${USER} 2>&1 | ${GREP} -q "no such user"
+ id ${USER} 2>/dev/null >/dev/null
if [ $? -eq 0 ]
then
+ echo "User '${USER}' already exists...proceeding."
+ else
echo "Creating '${USER}' user..."
${ADDUSER} -c "Common UNIX Printing System user" -g ${GROUP} -s /bin/sh ${USER}
echo "Done."
- else
- echo "User '${USER}' already exists...proceeding."
fi
;;
diff --git a/sysutils/ups-nut/pkg/INSTALL b/sysutils/ups-nut/pkg/INSTALL
index e9079880a8c..055fb288fc7 100644
--- a/sysutils/ups-nut/pkg/INSTALL
+++ b/sysutils/ups-nut/pkg/INSTALL
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: INSTALL,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $
+# $NetBSD: INSTALL,v 1.2 2001/08/12 19:55:57 veego Exp $
USER=@NUT_USER@
GROUP=@NUT_GROUP@
@@ -28,17 +28,17 @@ else
fi
${RM} -f "/tmp/grouptest.$$"
-# Use `finger' to be able to use NIS.
+# Use `id' to be able to use NIS.
#
-finger ${USER} 2>&1 | ${GREP} -q "no such user"
+id ${USER} 2>/dev/null >/dev/null
if [ $? -eq 0 ]
then
+ echo "User '${USER}' already exists...proceeding."
+else
echo "Creating '${USER}' user..."
${ADDUSER} \
-c "Network UPS Tools" \
-g ${GROUP} -s /bin/sh -m ${USER}
echo "Done."
-else
- echo "User '${USER}' already exists...proceeding."
fi
exit 0