Skip to content

Instantly share code, notes, and snippets.

// Intended usage: ./change-password.pxr <username> <oldPass> <newPass>
retcode ERR_SSH_FAILED 1 "Failed to ssh to $host: $output"
retcode ERR_UNKNOWN_PWD_OUTPUT 2 "The `passwd` command returned an unexpected output: $output"
retcode ERR_WRONG_PASSWORD 3 "The given oldPass is wrong"
retcode ERR_PASSWORD_DIDNT_SUCCEED 4 "The `passwd` command accepted the input but didn't succeed: $output"
retcode ERR_CONFIRM_DIDNT_SUCCEED 5 "The `passwd` confirmation accepted the input but didn't succeed: $output"
retcode ERR_UNKNOWN_SUDO_OUTPUT 6 "The `sudo` command returned an unexpected output: $output"
ssh andrew@foo.bar.baz