Commit 587a9528 authored by HgO's avatar HgO

Resolve "Improve certificates import (again)"

parent 602165c6
......@@ -603,31 +603,21 @@ function create_hypercube_file() {
"$PASSWORD_PATTERN" \
"$PASSWORD_PATTERN_DESCRIPTION"
info $"The directory containing your VPN certificates must have 3 files:"
info $"- The VPN client certificate (client.crt or user.crt)"
info $"- The VPN client private key (client.key or user.key)"
info $"- The VPN server certificate (ca.crt or ca-server.crt)"
info $"After ordering your VPN (see https://wiki.neutrinet.be/vpn/order), you should have received a mail with a zip file containing your VPN certificates."
info $"1. Unzip that file"
info $"2. Copy the certificates in the same directory as your private key (step 6 in the link above)"
info $"If you don't remember where these files are, you can follow this guide to generate new certificates: https://doku.neutrinet.be/en/vpn/renew-cert"
location_has_error=true
while $location_has_error
do
if confirm $"Would you like to import the VPN certificates from a directory?" "y"
read -e -r -p $"Enter your VPN certificates' location: " VPN_CERTIFICATES_LOCATION
if import_vpn_certificates "$VPN_CERTIFICATES_LOCATION"
then
read -e -r -p $"Enter your VPN certificates' location: " VPN_CERTIFICATES_LOCATION
if import_vpn_certificates "$VPN_CERTIFICATES_LOCATION"
then
location_has_error=false
fi
else
location_has_error=false
echo $"Enter your VPN client certificate"
info $"Paste all the content of client.crt below and end with a blank line: "
# See https://stackoverflow.com/questions/20913635/how-to-read-multi-line-input-in-a-bash-script/20913871#20913871
vpn_client_crt=$(sed '/^$/q' | sed '/^$/d')
echo $"Enter your VPN client key"
info $"Paste all the content of client.key below and end with a blank line: "
vpn_client_key=$(sed '/^$/q' | sed '/^$/d')
echo $"Enter the CA server certificate"
info $"Paste all the content of ca.crt below and end with a blank line: "
vpn_ca_crt=$(sed '/^$/q' | sed '/^$/d')
fi
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment