Last active
August 17, 2022 19:05
-
-
Save cmaggiulli/c4167390be1d5992b22d93f5dc2bf6e7 to your computer and use it in GitHub Desktop.
A shell script to automated the creation of the XML and zip file as per the Chase Paymentech specification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Payment tech sftp password reset file. | |
| # Script creates password and zip file based of PaymentTech specification | |
| # Chase should be ashamed of themselves for this | |
| # Author : Chris Maggiulli | |
| FILENAME="password_`date +'%y%m%d'`000.xml" | |
| ZIPNAME="password_`date +'%y%m%d'`000.zip" | |
| # Not using /dev/random so this can be ran by less privileged users | |
| PASSWORD=`openssl rand -base64 30 | tr -dc 'A-Z0-9' | fold -w 8 | head -n 1` | |
| touch $FILENAME | |
| echo "<passwordRequest>" >> $FILENAME | |
| echo "<userID>REDACTED</userID>" >> $FILENAME | |
| echo "<password>`echo $PASSWORD`</password>" >> $FILENAME | |
| echo "</passwordRequest>" >> $FILENAME | |
| zip $ZIPNAME $FILENAME | |
| cat $FILENAME | |
| rm -f $FILENAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment