Skip to content
Snippets Groups Projects
Commit 5b98efee authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

get-api-crl: Handle stray lock dir

parent e48c8987
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,13 @@ if [ -f /tmp/crl.pem ] && [ "$((`date +%s`-4*3600))" -lt "$((`date -r /tmp/crl.p
exit
fi
if [ -d /tmp/crldown ] && [ "$((`date +%s`-3600))" -lt "$((`date -r /tmp/crldown +%s`))" ] ; then
# If there's a really old stray lock, get rid of it.
rm -rf /tmp/crldown
fi
mkdir /tmp/crldown
trap 'rm -rf /tmp/crldown' EXIT ABRT QUIT TERM
trap 'rm -rf /tmp/crldown' EXIT ABRT QUIT TERM INT
cd /tmp/crldown
echo | openssl s_client -connect api.turris.cz:443 -showcerts | awk -v c=-1 '/-----BEGIN CERTIFICATE-----/{inc=1;c++} inc {print > (c ".pem")}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment