diff --git a/manifest.jps b/manifest.jps index bd36218..c223fec 100644 --- a/manifest.jps +++ b/manifest.jps @@ -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