File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -41,39 +41,39 @@ if [ "$(id -u)" != "0" ]; then
4141 exit 1
4242fi
4343
44- read -r -p " What user's password do you want to change? " user
44+ read -r -p " Enter the username whose password you want to change: " user
4545
4646if [ " $user " = " " ]; then
47- echo " ERROR: No user supplied " >&2
47+ echo " ERROR: No username provided. Please specify a username. " >&2
4848 exit 1
4949fi
5050
5151if ! id " $user " & > /dev/null ; then
52- echo " ERROR: No such user '$user '" >&2
52+ echo " ERROR: User '$user ' does not exist. Please check the username and try again. " >&2
5353 exit 1
5454fi
5555
56- echo -n " New password: "
56+ echo -n " Enter the new password for user ' $user ' : "
5757echo
5858get_password
5959first_input=" $password "
6060echo
6161
62- echo -n " Retype new password: "
62+ echo -n " Re-enter the new password to confirm : "
6363echo
6464get_password
6565second_input=" $password "
6666echo
6767
6868if [ ! " $first_input " = " $second_input " ]; then
69- echo " ERROR: Sorry, passwords do not match.
70- password unchanged" >&2
69+ echo " ERROR: Passwords do not match. Password has not been changed." >&2
7170 exit 1
7271fi
7372
7473if [ " $first_input " = " " ]; then
75- echo " ERROR: No password supplied " >&2
74+ echo " ERROR: No password provided. Please try again. " >&2
7675 exit 1
7776fi
7877
7978echo " ${user} :${password} " | chpasswd
79+ echo " SUCCESS: Password for user '$user ' has been updated successfully."
You can’t perform that action at this time.
0 commit comments