jbomb-automate #4

Merged
phanipavank merged 9 commits from jbomb-automate into master 2026-01-13 15:03:35 +00:00
Showing only changes of commit aa297095b0 - Show all commits

12
jconf Normal file → Executable file
View 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
;;