From d558f33fdc72ee0c1088232671925c92d824eb62 Mon Sep 17 00:00:00 2001 From: thib Date: Thu, 4 Jan 2001 15:50:41 +0000 Subject: [PATCH] better handle of the abscence of both useradd and addus --- script/user-group | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/user-group b/script/user-group index 4a557f3..77b29eb 100755 --- a/script/user-group +++ b/script/user-group @@ -4,7 +4,7 @@ # them if necessary. # -# $Id: user-group,v 1.1 2000-11-18 14:51:47 thib Exp $ +# $Id: user-group,v 1.2 2001-01-04 15:50:41 thib Exp $ # take 2 arguments : username # groupname @@ -27,11 +27,18 @@ if grep "^$USERNAME:" /etc/passwd > /dev/null; then INSTALLED=1 else echo "no." + CMD="" if useradd -D 2> /dev/null; then CMD="useradd -c 'fcron' fcron" elif adduser -D 2> /dev/null; then CMD="adduser -c 'fcron' fcron" fi + if test -z "$CMD"; then + echo "Could not determine the command to use to add a user." + echo "Please add user \"$USERNAME\" (group \"GROUPNAME\") manually" + echo "(or choose another username with configure script)." + exit 1 + fi while test \( ! -z "$INSTALL" \) -a \( "$INSTALL" != "y" \) -a \( "$INSTALL" != "n" \); do echo "Would you like to add $USERNAME in /etc/passwd with the following command ?" -- 2.40.0