Last active
October 25, 2018 08:17
-
-
Save markuman/40f3401e5bf599c9158e9d0790a51c57 to your computer and use it in GitHub Desktop.
This file contains 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
secrets/* |
This file contains 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 | |
mkdir -p secrets | |
for fullname in cryptsecrets/*; do | |
filename=$(basename -- "$fullname") | |
extension="${filename##*.}" | |
filename="${filename%.*}" | |
openssl rsautl -decrypt -inkey ~/.ssh/aws-it.pem -in "$fullname" > secrets/"$filename"."$extension" | |
done |
This file contains 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 | |
mkdir -p cryptsecrets | |
for fullname in secrets/*; do | |
filename=$(basename -- "$fullname") | |
extension="${filename##*.}" | |
filename="${filename%.*}" | |
cat "$fullname" | openssl rsautl -encrypt -pubin -inkey ~/.ssh/aws-it.pem -ssl > cryptsecrets/"$filename"."$extension" | |
done | |
git add -f cryptsecrets/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment