Browse Source

fix duplicate fi

HgO 1 year ago
parent
commit
eda89563fb
1 changed files with 3 additions and 5 deletions
  1. 3 5
      conf/ynh-vpnclient

+ 3 - 5
conf/ynh-vpnclient

@@ -328,11 +328,9 @@ check_config() {
     if [[ $login_user == "" || $login_passphrase == "" ]]; then
       critical "You need either a client certificate, either a username, or both (you can add one through the web admin)"
     fi
-  elif [[ -e /etc/openvpn/keys/user.crt ]] && ! openssl x509 -in /etc/openvpn/keys/user.crt -noout -checkend 0 >/dev/null
-    then
-      user_cert_expired_date=$(openssl x509 -in /etc/openvpn/keys/user.crt -noout -enddate | cut -d '=' -f 2)
-      critical "The client certificate expired on $user_cert_expired_date"
-    fi
+  elif [[ -e /etc/openvpn/keys/user.crt ]] && ! openssl x509 -in /etc/openvpn/keys/user.crt -noout -checkend 0 >/dev/null; then
+    user_cert_expired_date=$(openssl x509 -in /etc/openvpn/keys/user.crt -noout -enddate | cut -d '=' -f 2)
+    critical "The client certificate expired on $user_cert_expired_date"
   fi
 }