22 lines
556 B
Bash
22 lines
556 B
Bash
#!/bin/bash
|
|
# ___ _ _ _ __
|
|
# / __|| |_ | |_ ___ | '_ \ ___
|
|
# \__ \| _|| \ / _ \| .__// -_)
|
|
# |___/ \__||_||_|\___/|_| \___|
|
|
|
|
## nano ~/.bashrc
|
|
## and add this to the end of the file: export PATH=$PATH:~/bin
|
|
## sudo chmod +x ~/bin/*;su -l $USER
|
|
|
|
### USAGE:
|
|
|
|
U=$1
|
|
P=$2
|
|
R=$4
|
|
|
|
if [ "$3" = "sudo" ]
|
|
then
|
|
echo $4 | sudo -S adduser $U --gecos "69,69,69,69" --disabled-password;echo "$U:$P" | sudo chpasswd;usermod -aG sudo $U
|
|
else
|
|
adduser $U --gecos "69,69,69,69" --disabled-password;echo "$U:$P" | chpasswd;usermod -aG sudo $U
|
|
fi |