diff options
author | Peter Wemm <peter@FreeBSD.org> | 1997-05-29 03:21:14 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1997-05-29 03:21:14 +0000 |
commit | 6ef4ce131f687aa5143fc3d25f30370a70d9f068 (patch) | |
tree | 0ad326da46b69f698ee132072a040a366507dfaa /net/cvsup-mirror/pkg-install | |
parent | 24a2268c29baa03da5653ac72be12d3a6fbbd19c (diff) | |
download | ports-6ef4ce131f687aa5143fc3d25f30370a70d9f068.tar.gz ports-6ef4ce131f687aa5143fc3d25f30370a70d9f068.zip |
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.
Notes
Notes:
svn path=/head/; revision=6613
Diffstat (limited to 'net/cvsup-mirror/pkg-install')
-rw-r--r-- | net/cvsup-mirror/pkg-install | 4 |
1 files changed, 2 insertions, 2 deletions
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}\"." |