initial commit of file from CVS for smeserver-openvpn-bridge on Sat Sep 7 19:57:25 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 19:57:25 +10:00
parent d755aea606
commit 9dcb47db31
73 changed files with 14036 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
#!/bin/bash
URL=$(/sbin/e-smith/db configuration getprop openvpn-bridge CrlUrl)
DOMAIN=$(/sbin/e-smith/db configuration get DomainName)
/usr/bin/wget $URL -O /tmp/cacrl.pem > /dev/null 2>&1
/usr/bin/openssl crl -inform PEM -in /tmp/cacrl.pem -text > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
/bin/mv -f /tmp/cacrl.pem /etc/openvpn/bridge/pub/cacrl.pem > /dev/null 2>&1
else
cat > /tmp/crlmail <<END
An error occured while updating the CRL for OpenVPN-Bridge
because openssl didn't recognize the file as a valid CRL.
Below is the copy of the latest CRL downloaded from
$URL
END
cat /tmp/cacrl.pem >> /tmp/crlmail
mail -s 'CRL update failed' admin@$DOMAIN < /tmp/crlmail
fi
rm -f /tmp/cacrl.pem
rm -f /tmp/crlmail