An OpenVPN daemon in routed mode on SME Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
851 B

12 years ago
#!/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
12 years ago
/usr/bin/openssl crl -inform PEM -in /tmp/cacrl_routed.pem -text > /dev/null 2>&1
12 years ago
if [ "$?" -eq "0" ]; then
/bin/mv -f /tmp/cacrl_routed.pem /etc/openvpn/routed/pub/cacrl.pem > /dev/null 2>&1
12 years ago
else
cat > /tmp/crlmail_routed <<END
12 years ago
An error occured while updating the CRL for OpenVPN-Routed
12 years ago
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
12 years ago
fi
rm -f /tmp/cacrl_routed.pem
rm -f /tmp/crlmail_routed