Use different name for the crl to prevent race conditions with openvpn-bridge

tags/0.0.1 0.0.1
Daniel Berteaud 12 years ago
parent 9d0d164b4d
commit 2d0c9d80dd
  1. 16
      root/etc/e-smith/events/actions/openvpn-routed-update-crl

@ -7,14 +7,14 @@ if [ -z $URL ]; then
exit 0 exit 0
fi 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 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 else
cat > /tmp/crlmail <<END cat > /tmp/crlmail_routed <<END
An error occured while updating the CRL for OpenVPN-Routed An error occured while updating the CRL for OpenVPN-Routed
because openssl didn't recognize the file as a valid CRL. because openssl didn't recognize the file as a valid CRL.
@ -24,9 +24,9 @@ $URL
END END
cat /tmp/cacrl.pem >> /tmp/crlmail cat /tmp/cacrl_routed.pem >> /tmp/crlmail_routed
mail -s 'CRL update failed' admin@$DOMAIN < /tmp/crlmail mail -s 'CRL update failed' admin@$DOMAIN < /tmp/crlmail_routed
fi fi
rm -f /tmp/cacrl.pem rm -f /tmp/cacrl_routed.pem
rm -f /tmp/crlmail rm -f /tmp/crlmail_routed

Loading…
Cancel
Save