linutil/tabs/utils/user-account-manager/change_password.sh
Nyx 7bd9f8aee8
Fix bashisms (#512)
Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
2024-09-19 11:39:09 -05:00

20 lines
488 B
Bash
Executable File

#!/bin/sh -e
. ../../common-script.sh
. ./utility_functions.sh
clear
printf "%b\n" "${YELLOW}Change password${RC}"
printf "%b\n" "${YELLOW}=================${RC}"
username=$(promptUsername "" "root") || exit 1
password=$(promptPassword) || exit 1
printf "Are you sure you want to change password for $username? [Y/N]: "
read -r confirm
confirmAction || exit 1
echo "$username:$password" | $ESCALATION_TOOL chpasswd
printf "%b\n" "${GREEN}Password changed successfully${RC}"
checkEnv