From 291d1795539c57a14677d1c5576057b30625163a Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 29 May 1997 03:21:14 +0000 Subject: Don't grep /etc/passwd and /etc/group for checking the existance of users since it doesn't see yp/nis. Use 'pw {user|group} show ...' and check the return code, otherwise the script can try and add an already existing user or group. --- net/cvsup-mirror/pkg-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net') diff --git a/net/cvsup-mirror/pkg-install b/net/cvsup-mirror/pkg-install index 53f97b7f98d6..fc96e3c0fb7c 100644 --- a/net/cvsup-mirror/pkg-install +++ b/net/cvsup-mirror/pkg-install @@ -94,7 +94,7 @@ EOF fi echo "" - if grep -q "^${group}:" /etc/group; then + if pw group show "${group}" 2>/dev/null; then echo "You already have a group \"${group}\", so I will use it." else echo "You need a group \"${group}\"." @@ -111,7 +111,7 @@ EOF fi fi - if grep -q "^${user}:" /etc/passwd; then + if pw user show "${user}" 2>/dev/null; then echo "You already have a user \"${user}\", so I will use it." else echo "You need a user \"${user}\"." -- cgit