initial commit of file from CVS for smeserver-openvpn-routed on Thu 6 Mar 14:40:52 GMT 2025

This commit is contained in:
2025-03-06 14:40:52 +00:00
parent 08020c8369
commit 73d65d729e
38 changed files with 866 additions and 2 deletions

View File

@@ -0,0 +1,32 @@
#!/bin/bash
URL=$(/sbin/e-smith/db configuration getprop openvpn-routed CrlUrl)
DOMAIN=$(/sbin/e-smith/db configuration get DomainName)
if [ -z $URL ]; then
exit 0
fi
/usr/bin/wget $URL -O /tmp/cacrl_routed.pem > /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_routed.pem /etc/openvpn/routed/pub/cacrl.pem > /dev/null 2>&1
else
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.
Below is the copy of the latest CRL downloaded from
$URL
END
cat /tmp/cacrl_routed.pem >> /tmp/crlmail_routed
mail -s 'CRL update failed' admin@$DOMAIN < /tmp/crlmail_routed
fi
rm -f /tmp/cacrl_routed.pem
rm -f /tmp/crlmail_routed