linutil/tabs/utils/user-account-manager/change_password.sh
JEEVITHA KANNAN K S f64fa2bd12
feat: Add User Manager (#393)
* Add User Control Panel

* Fix non posix

* Split script

* Update userguide.md

* Update utility_functions.sh

* Remove clear

* Add checkEnv
2024-09-18 20:48:42 -05:00

19 lines
481 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
read -p "Are you sure you want to change password for $username? [Y/N]: " confirm
confirmAction || exit 1
echo "$username:$password" | $ESCALATION_TOOL chpasswd
printf "%b\n" "${GREEN}Password changed successfully${RC}"
checkEnv