Last active
September 14, 2017 03:10
-
-
Save tfentonz/99e03802fe112008e803d84527041baa to your computer and use it in GitHub Desktop.
Fix Private Key
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 | |
# | |
# Replace spaces with @'s | |
# Replace @'s in BEGIN with spaces | |
# Replace @'s in END with spaces | |
# Replace @'s with newlines | |
sed -i '' -e 's/ /@/g | |
s/-----BEGIN@RSA@PRIVATE@KEY-----/-----BEGIN RSA PRIVATE KEY-----/ | |
s/-----END@RSA@PRIVATE@KEY-----/-----END RSA PRIVATE KEY-----/ | |
s/@/\'$'\n/g' $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment