Skip to content

Instantly share code, notes, and snippets.

@tox2ik
Last active June 13, 2020 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tox2ik/4378ea124405ab5adca33d0292573c46 to your computer and use it in GitHub Desktop.
Save tox2ik/4378ea124405ab5adca33d0292573c46 to your computer and use it in GitHub Desktop.
#!/bin/bash
declare -a subjects=()
cdupe() { grep -i begin.cert -A 3 ${1:-} | sort -u | wc -l ; }
for i in /etc/frbitx/container/haproxy/certs/*;
do
uniq_lines=`cdupe $i`;
if [[ $uniq_lines == 5 ]]; then
subject=$(openssl x509 -noout -in $i -subject |
awk '{ print $(NF)}')
echo broken: $i $subject
subjects+=($subject)
fi
done
lewatch renew -r -s 222 ${subjects[@]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment