|
@@ -103,22 +103,6 @@ check_config() {
|
|
|
critical "You need a CA server (you can add it through the web admin)"
|
|
|
fi
|
|
|
|
|
|
- latest_ca_server_cert_expiry_timestamp=0
|
|
|
- while ca_server_cert_expiry_date=$(openssl x509 -noout -enddate 2>/dev/null); do
|
|
|
- ca_server_cert_expiry_date=$(cut -f 2 -d '=' <<< "$ca_server_cert_expiry_date")
|
|
|
- ca_server_cert_expiry_timestamp=$(date +'%s' -d "$ca_server_cert_expiry_date")
|
|
|
-
|
|
|
- if [[ "$ca_server_cert_expiry_timestamp" -ge "$latest_ca_server_cert_expiry_timestamp" ]]; then
|
|
|
- latest_ca_server_cert_expiry_timestamp="$ca_server_cert_expiry_timestamp"
|
|
|
- latest_ca_server_cert_expiry_date="$ca_server_cert_expiry_date"
|
|
|
- fi
|
|
|
- done < /etc/openvpn/keys/ca-server.crt
|
|
|
-
|
|
|
- today_timestamp=$(date +'%s')
|
|
|
- if [[ "$latest_ca_server_cert_expiry_timestamp" -ge "$today_timestamp" ]]; then
|
|
|
- critical "The CA server expired on $latest_ca_server_cert_expiry_date"
|
|
|
- fi
|
|
|
-
|
|
|
if [[ ! -e /etc/openvpn/keys/user.crt || ! -e /etc/openvpn/keys/user.key ]]; then
|
|
|
if [[ -s /etc/openvpn/keys/credentials ]]; then
|
|
|
login_user=$(sed -n 1p /etc/openvpn/keys/credentials)
|