Browse Source

Add test that user certificate is still valid when starting VPN

Alexandre Aubin 4 years ago
parent
commit
cae24bd9c8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      conf/ynh-vpnclient

+ 5 - 0
conf/ynh-vpnclient

@@ -425,6 +425,11 @@ case "${1}" in
       exit 0
     fi
 
+    if [ ! -e /etc/openvpn/keys/user.crt ] || ! cat /etc/openvpn/keys/user.crt | openssl x509 -noout -checkend 0 >/dev/null
+    then
+        critical "Failed to start OpenVPN client : user certificate expired"
+    fi
+
     info "[vpnclient] Starting..."
     touch /tmp/.ynh-vpnclient-started