From: Thibault Godouet Date: Thu, 4 Jan 2001 15:50:41 +0000 (+0000) Subject: better handle of the abscence of both useradd and addus X-Git-Tag: ver2_9_4~458 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=212e216719183c78b13e7110dc4bcb0970d5504d;p=thirdparty%2Ffcron.git better handle of the abscence of both useradd and addus --- 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 ?"