11 lines
337 B
Bash
11 lines
337 B
Bash
|
|
# Pass an argument with the username and that will be created and added to the sudo group
|
||
|
|
|
||
|
|
no_argument_was_passed=false; [ -z "$1" ] && no_argument_was_passed=true
|
||
|
|
$no_argument_was_passed && echo "No username has been passed" && return
|
||
|
|
|
||
|
|
USERNAME=$1
|
||
|
|
echo "Creating user $USERNAME"
|
||
|
|
adduser $USERNAME
|
||
|
|
usermod -aG sudo $USERNAME
|
||
|
|
echo "Done"
|