echo "Nom du client : "
read name

cd /etc/openvpn/easy-rsa
source vars
/etc/openvpn/easy-rsa/build-key-pass $name

cd ..

cp clés/exemple.ovpn clés/$name.ovpn

echo "<ca>" >> clés/$name.ovpn
cat clés/ca.crt >> clés/$name.ovpn
echo "</ca>" >> clés/$name.ovpn
echo "" >> clés/$name.ovpn
echo "<cert>" >> clés/$name.ovpn
cat easy-rsa/keys/$name.crt >> clés/$name.ovpn
echo "</cert>" >> clés/$name.ovpn
echo "" >> clés/$name.ovpn
echo "<key>" >> clés/$name.ovpn
cat easy-rsa/keys/$name.key >> clés/$name.ovpn
echo "</key>" >> clés/$name.ovpn
echo "" >> clés/$name.ovpn
echo "key-direction 1" >> clés/$name.ovpn
echo "<tls-auth>" >> clés/$name.ovpn
cat clés/ta.key >> clés/$name.ovpn
echo "</tls-auth>" >> clés/$name.ovpn

