From 3ab1ba0d21b93a092cab5fd85a4dd8aecb8c3f18 Mon Sep 17 00:00:00 2001 From: sliker1 Date: Sun, 31 Mar 2013 22:19:11 +0200 Subject: [PATCH] some changes on ffuseradd.sh but not ready yet... HAPPY EASTERDAYS! (but no eastereggs included) --- ffuseradd.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/ffuseradd.sh b/ffuseradd.sh index c988a4f..a14b1a6 100755 --- a/ffuseradd.sh +++ b/ffuseradd.sh @@ -1,12 +1,23 @@ #!/bin/bash -if [ "$1" = "" ]; then - echo -e "\nUSAGE: ffuseradd ... [EMAIL ADDRESS]...\nUsername is\ - necessary!\nEmail address is optional." +NMEUSR=$1 +EMLUSR=$2 +GRPUSR=$3 +ADDUSR="$(which useradd) -m -G" + + +if [ "$NMEUSR" = "" ]; then + echo -e "\nUSAGE: ffuseradd ... [EMAIL ADDRESS]... [GROUP]... \nUsername is\ + necessary!\nEmail address and group are optional.\nGroups for example: sudo,www-user. Ever add multible groups \",\" separated! Leave it blank for standard user." + exit else - if [ "$2" = "" ]; then - echo -e "You entered username:\n Username:"$1"\n Email address: none" + if [ "$EMLUSR" = "" ]; then + echo -e "You entered username:\n Username: "$NMEUSR"\n Email address: none" else - echo -e "You entered username:\n Username:"$1"\n Email address: "$2"" + echo -e "You entered username:\n Username: "$NMEUSR"\n Email address: "$EMLUSR"" fi fi + +# Adding user +echo -e "\nadding user "$NMEUSR" with "$ADDUSR"" +echo $GRPUSR