diff --git a/README.md b/README.md index 4ff0a04..f096531 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ If you want to customise your installation, you can export them or specify them - `MULTI_CLIENT=n` - `CLIENT_CERT_DURATION_DAYS=3650` - `SERVER_CERT_DURATION_DAYS=3650` +- `NEW_CLIENT=y` (set to `n` to skip client creation after installation) If the server is behind NAT, you can specify its endpoint with the `ENDPOINT` variable. If the endpoint is the public IP address which it is behind, you can use `ENDPOINT=$(curl -4 ifconfig.co)` (the script will default to this). The endpoint can be an IPv4 or a domain. diff --git a/openvpn-install.sh b/openvpn-install.sh index 02a57e8..7578f61 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -990,6 +990,7 @@ function installOpenVPN() { CLIENT_CERT_DURATION_DAYS=${CLIENT_CERT_DURATION_DAYS:-$DEFAULT_CERT_VALIDITY_DURATION_DAYS} SERVER_CERT_DURATION_DAYS=${SERVER_CERT_DURATION_DAYS:-$DEFAULT_CERT_VALIDITY_DURATION_DAYS} CONTINUE=${CONTINUE:-y} + NEW_CLIENT=${NEW_CLIENT:-y} if [[ -z $ENDPOINT ]]; then ENDPOINT=$(resolvePublicIP) @@ -1517,9 +1518,13 @@ verb 3" >>/etc/openvpn/server/client-template.txt fi # Generate the custom client.ovpn - log_info "Generating first client certificate..." - newClient - log_success "If you want to add more clients, you simply need to run this script another time!" + if [[ $NEW_CLIENT == "n" ]]; then + log_info "No clients added. To add clients, simply run the script again." + else + log_info "Generating first client certificate..." + newClient + log_success "If you want to add more clients, you simply need to run this script another time!" + fi } # Helper function to get the home directory for storing client configs