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