Skip to content

Instantly share code, notes, and snippets.

@manstie
Created August 27, 2021 07:54
Show Gist options
  • Save manstie/89ffa9ec2ee8c2cd3088744d4e19212c to your computer and use it in GitHub Desktop.
Save manstie/89ffa9ec2ee8c2cd3088744d4e19212c to your computer and use it in GitHub Desktop.
Create a "correctly hashed certificate directory"
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