Created
August 27, 2021 07:54
-
-
Save manstie/89ffa9ec2ee8c2cd3088744d4e19212c to your computer and use it in GitHub Desktop.
Create a "correctly hashed certificate directory"
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
shopt -s extglob | |
shopt -s nullglob | |
for i in *.[0-9]; do | |
rm $i | |
done | |
# create a hashed directory for ssl use | |
for i in *.@(cer|crt|pem); do | |
hash=`openssl x509 -hash -noout -in $i` | |
declare -i j=0 | |
while [ -f "$hash.$j" ]; do | |
j+=1 | |
done | |
ln -s $i "$hash.$j" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment