Last active
June 13, 2020 10:15
-
-
Save tox2ik/4378ea124405ab5adca33d0292573c46 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
#!/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