Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote vars in user account manager #507

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tabs/utils/user-account-manager/add_to_group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ groups_to_add=$(echo "$groups" | tr ' ' ',')
read -p "Are you sure you want to add user $username to $groups_to_add? [Y/N]: " confirm
confirmAction || exit 1

$ESCALATION_TOOL usermod -aG $groups_to_add "$username"
"$ESCALATION_TOOL" usermod -aG $groups_to_add "$username"

printf "%b\n" "${GREEN}User successfully added to the $groups_to_add${RC}"

checkEnv
checkEnv
checkEscalationTool
5 changes: 3 additions & 2 deletions tabs/utils/user-account-manager/add_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ fi

password=$(promptPassword) || exit 1

$ESCALATION_TOOL useradd -m "$username" -g users -s /bin/bash
echo "$username:$password" | $ESCALATION_TOOL chpasswd
"$ESCALATION_TOOL" useradd -m "$username" -g users -s /bin/bash
echo "$username:$password" | "$ESCALATION_TOOL" chpasswd

printf "%b\n" "${GREEN}User $username created successfully${RC}"
printf "%b\n" "${GREEN}To add additional groups use Add User To Groups${RC}"

checkEnv
checkEscalationTool
5 changes: 3 additions & 2 deletions tabs/utils/user-account-manager/change_password.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ password=$(promptPassword) || exit 1
read -p "Are you sure you want to change password for $username? [Y/N]: " confirm
confirmAction || exit 1

echo "$username:$password" | $ESCALATION_TOOL chpasswd
echo "$username:$password" | "$ESCALATION_TOOL" chpasswd
printf "%b\n" "${GREEN}Password changed successfully${RC}"

checkEnv
checkEnv
checkEscalationTool
5 changes: 3 additions & 2 deletions tabs/utils/user-account-manager/delete_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ fi
read -p "Are you sure you want to delete user $username? [Y/N]: " confirm
confirmAction || exit 1

$ESCALATION_TOOL userdel --remove "$username" 2>/dev/null
"$ESCALATION_TOOL" userdel --remove "$username" 2>/dev/null
printf "%b\n" "${GREEN}User $username deleted successfully${RC}"

checkEnv
checkEnv
checkEscalationTool
5 changes: 3 additions & 2 deletions tabs/utils/user-account-manager/remove_from_group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ groups_to_remove=$(echo "$groups" | tr ' ' ',')
read -p "Are you sure you want to remove user $username from $groups_to_remove? [Y/N]: " confirm
confirmAction || exit 1

$ESCALATION_TOOL usermod -rG $groups_to_remove "$username"
"$ESCALATION_TOOL" usermod -rG $groups_to_remove "$username"

printf "%b\n" "${GREEN}User successfully removed from $groups_to_remove${RC}"

checkEnv
checkEnv
checkEscalationTool
Loading