Use different name for the crl to prevent race conditions with openvpn-bridge
This commit is contained in:
parent
9d0d164b4d
commit
2d0c9d80dd
|
@ -7,14 +7,14 @@ if [ -z $URL ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
/usr/bin/wget $URL -O /tmp/cacrl.pem > /dev/null 2>&1
|
||||
/usr/bin/wget $URL -O /tmp/cacrl_routed.pem > /dev/null 2>&1
|
||||
|
||||
/usr/bin/openssl crl -inform PEM -in /tmp/cacrl.pem -text > /dev/null 2>&1
|
||||
/usr/bin/openssl crl -inform PEM -in /tmp/cacrl_routed.pem -text > /dev/null 2>&1
|
||||
|
||||
if [ "$?" -eq "0" ]; then
|
||||
/bin/mv -f /tmp/cacrl.pem /etc/openvpn/routed/pub/cacrl.pem > /dev/null 2>&1
|
||||
/bin/mv -f /tmp/cacrl_routed.pem /etc/openvpn/routed/pub/cacrl.pem > /dev/null 2>&1
|
||||
else
|
||||
cat > /tmp/crlmail <<END
|
||||
cat > /tmp/crlmail_routed <<END
|
||||
|
||||
An error occured while updating the CRL for OpenVPN-Routed
|
||||
because openssl didn't recognize the file as a valid CRL.
|
||||
|
@ -24,9 +24,9 @@ $URL
|
|||
|
||||
END
|
||||
|
||||
cat /tmp/cacrl.pem >> /tmp/crlmail
|
||||
mail -s 'CRL update failed' admin@$DOMAIN < /tmp/crlmail
|
||||
cat /tmp/cacrl_routed.pem >> /tmp/crlmail_routed
|
||||
mail -s 'CRL update failed' admin@$DOMAIN < /tmp/crlmail_routed
|
||||
fi
|
||||
|
||||
rm -f /tmp/cacrl.pem
|
||||
rm -f /tmp/crlmail
|
||||
rm -f /tmp/cacrl_routed.pem
|
||||
rm -f /tmp/crlmail_routed
|
||||
|
|
Loading…
Reference in New Issue