|
|
@ -121,6 +121,7 @@ wget "https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.6/EasyRSA-unix- |
|
|
|
tar -xaf "EasyRSA-unix-v3.0.6.tgz" |
|
|
|
tar -xaf "EasyRSA-unix-v3.0.6.tgz" |
|
|
|
mv "EasyRSA-v3.0.6" /etc/openvpn/easy-rsa |
|
|
|
mv "EasyRSA-v3.0.6" /etc/openvpn/easy-rsa |
|
|
|
rm "EasyRSA-unix-v3.0.6.tgz" |
|
|
|
rm "EasyRSA-unix-v3.0.6.tgz" |
|
|
|
|
|
|
|
|
|
|
|
cd /etc/openvpn/easy-rsa |
|
|
|
cd /etc/openvpn/easy-rsa |
|
|
|
|
|
|
|
|
|
|
|
if [[ ! -z $key_size ]]; then |
|
|
|
if [[ ! -z $key_size ]]; then |
|
|
@ -231,8 +232,14 @@ sed -i "s/\$user = '';/\$user = '$mysql_user';/" "./include/config.php" |
|
|
|
sed -i "s/\$pass = '';/\$pass = '$mysql_pass';/" "./include/config.php" |
|
|
|
sed -i "s/\$pass = '';/\$pass = '$mysql_pass';/" "./include/config.php" |
|
|
|
|
|
|
|
|
|
|
|
# Replace in the client configurations with the ip of the server and openvpn protocol |
|
|
|
# Replace in the client configurations with the ip of the server and openvpn protocol |
|
|
|
for file in "./client-conf/gnu-linux/client.conf" "./client-conf/osx-viscosity/client.conf" "./client-conf/windows/client.ovpn"; do |
|
|
|
for file in $(find -name client.ovpn); do |
|
|
|
sed -i "s/remote xxx\.xxx\.xxx\.xxx 443/remote $ip_server $server_port/" $file |
|
|
|
sed -i "s/remote xxx\.xxx\.xxx\.xxx 443/remote $ip_server $server_port/" $file |
|
|
|
|
|
|
|
echo "<ca>" >> $file |
|
|
|
|
|
|
|
cat "/etc/openvpn/ca.crt" >> $file |
|
|
|
|
|
|
|
echo "</ca>" >> $file |
|
|
|
|
|
|
|
echo "<tls-auth>" >> $file |
|
|
|
|
|
|
|
cat "/etc/openvpn/ta.key" >> $file |
|
|
|
|
|
|
|
echo "</tls-auth>" |
|
|
|
|
|
|
|
|
|
|
|
if [ $openvpn_proto = "udp" ]; then |
|
|
|
if [ $openvpn_proto = "udp" ]; then |
|
|
|
sed -i "s/proto tcp-client/proto udp/" $file |
|
|
|
sed -i "s/proto tcp-client/proto udp/" $file |
|
|
|