diff --git a/src/freedombone-app-vpn b/src/freedombone-app-vpn index 6147a86c..cd1a2462 100755 --- a/src/freedombone-app-vpn +++ b/src/freedombone-app-vpn @@ -304,11 +304,18 @@ function install_vpn { y y ' | ./build-key-server $OPENVPN_SERVER_NAME - if [ ! -f /etc/openvpn/easy-rsa/keys/$OPENVPN_SERVER_NAME.crt ]; then + if [ ! -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt ]; then echo $'OpenVPN crt not found' exit 7823352 fi - if [ ! -f /etc/openvpn/easy-rsa/keys/$OPENVPN_SERVER_NAME.key ]; then + server_cert=$(cat /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt) + if [ ${#server_cert} -lt 10 ]; then + cat /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt + echo $'Server cert generation failed' + exit 3284682 + fi + + if [ ! -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.key ]; then echo $'OpenVPN key not found' exit 6839436 fi