jbomb-automate #4
12
jconf
Normal file → Executable file
12
jconf
Normal file → Executable file
@@ -48,12 +48,12 @@ case "$cmd" in
|
||||
echo "$2 user already exists"
|
||||
else
|
||||
while true; do
|
||||
read -p "Do you want to create an user account $2 [Y/n]:" yn
|
||||
read -rp "Do you want to create an user account $2 [Y/n]:" yn
|
||||
case $yn in
|
||||
[Yy]* )
|
||||
useradd $2;
|
||||
useradd "$2";
|
||||
echo "Enter the password for $2:";
|
||||
passwd $2
|
||||
passwd "$2"
|
||||
echo "$2 user account created successfully";
|
||||
break;;
|
||||
[Nn]* ) exit 1;;
|
||||
@@ -73,10 +73,10 @@ case "$cmd" in
|
||||
else
|
||||
|
||||
while true; do
|
||||
read -p "Do you want to delete $2 user account? [Y/n]:" yn
|
||||
read -rp "Do you want to delete $2 user account? [Y/n]:" yn
|
||||
case $yn in
|
||||
[Yy]* )
|
||||
userdel -rRZ $2;
|
||||
userdel -rRZ "$2";
|
||||
echo "$2 user account deleted successfully";
|
||||
break;;
|
||||
[Nn]* ) exit 1;;
|
||||
@@ -88,7 +88,7 @@ case "$cmd" in
|
||||
;;
|
||||
|
||||
listusers)
|
||||
husers= awk -F: '{ if ($3 >= 1000 && $1 != "nobody" ) {print $1}}' /etc/passwd
|
||||
husers=$(awk -F: '{ if ($3 >= 1000 && $1 != "nobody" ) {print $1}}' /etc/passwd)
|
||||
echo $husers
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user