From 0131635a045c22447b18cbc0c6b23b31f8e30a09 Mon Sep 17 00:00:00 2001 From: veego Date: Sun, 12 Aug 2001 19:55:56 +0000 Subject: 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. --- sysutils/ups-nut/pkg/INSTALL | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sysutils') 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 -- cgit v1.2.3