Updated pwd reset
parent
cf5a47ca36
commit
7d6eb40d13
|
@ -257,17 +257,18 @@ actions:
|
|||
|
||||
jps_log "INFO" "Changing password for user: ${settings.manage_username}" "password_change.log"
|
||||
|
||||
# Change password without logging to stdout
|
||||
if echo "${settings.manage_username}:${globals.password}" | chpasswd; then
|
||||
# Change password using echo and chpasswd
|
||||
if echo "${settings.manage_username}:${globals.password}" | /usr/sbin/chpasswd; then
|
||||
jps_log "SUCCESS" "Password changed successfully for ${settings.manage_username}" "password_change.log"
|
||||
echo "Password changed for ${settings.manage_username} at $(date)" >> /home/jelastic/add-sftp-user-addon/logs/script_output.log
|
||||
exit 0
|
||||
else
|
||||
jps_log "ERROR" "Failed to change password for ${settings.manage_username}" "password_change.log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jps_log "SUCCESS" "======== PASSWORD CHANGE COMPLETED ========" "password_change.log"
|
||||
} &> /home/jelastic/add-sftp-user-addon/logs/password_change.log
|
||||
} &>> /home/jelastic/add-sftp-user-addon/logs/password_change.log
|
||||
- if ("${response.exitStatus}" != "0"):
|
||||
return: passwordChangeError
|
||||
- return: passwordChangeSuccess
|
||||
|
|
Loading…
Reference in New Issue