Merge pull request #945 from rsalas/create_script_freevpn

Create script freevpn
This commit is contained in:
Kristian Haugene
2020-02-02 21:48:44 +01:00
committed by GitHub
29 changed files with 108 additions and 58 deletions

View File

@@ -1,7 +1,7 @@
client
proto tcp
remote server5-pl.freevpn.be 443
explicit-exit-notify
connect-retry-max 3
connect-retry 3
resolv-retry 15
@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -1,7 +1,7 @@
client
proto tcp
remote server5-pl.freevpn.be 80
explicit-exit-notify
connect-retry-max 3
connect-retry 3
resolv-retry 15
@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
<ca>

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
<ca>

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo
@@ -42,6 +42,7 @@ CPhk+BqvxjzX1v2dkmVQCu4Jefy43knX10RyE23G6fTWncL2aXREb0CZ73lOT/AL
K6dA+91oqeMSXMl4TVzNOeky
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
MIIDWDCCAkCgAwIBAgIRAI2i+HeFYlzMzS0ud+ck2QYwDQYJKoZIhvcNAQELBQAw
GTEXMBUGA1UEAwwOd3d3LkZyZWVWUE4uaXQwHhcNMTkxMDA2MDYzMzM4WhcNMjkx
@@ -62,6 +63,7 @@ vFqPDEpGHH+BEnK6FB7l9QBjDIj7quSJs4VHgSpmvzqoORjU+DlXA/ryQQjZEmG5
z7gR3YzOFgio+Ie5MyQxuJ/ijMNV/M4T0I7Oa2XtLBIOIQMuc08wbib/nKnOtPqy
rowAtSd3lX0/7bbQeu8vWA2AQoK9x3sfuXA2N5hJALSNRIs2j3d9NRer90Y=
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDVyEutVio9FSAZ

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo
@@ -42,6 +42,7 @@ CPhk+BqvxjzX1v2dkmVQCu4Jefy43knX10RyE23G6fTWncL2aXREb0CZ73lOT/AL
K6dA+91oqeMSXMl4TVzNOeky
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
MIIDWDCCAkCgAwIBAgIRAI2i+HeFYlzMzS0ud+ck2QYwDQYJKoZIhvcNAQELBQAw
GTEXMBUGA1UEAwwOd3d3LkZyZWVWUE4uaXQwHhcNMTkxMDA2MDYzMzM4WhcNMjkx
@@ -62,6 +63,7 @@ vFqPDEpGHH+BEnK6FB7l9QBjDIj7quSJs4VHgSpmvzqoORjU+DlXA/ryQQjZEmG5
z7gR3YzOFgio+Ie5MyQxuJ/ijMNV/M4T0I7Oa2XtLBIOIQMuc08wbib/nKnOtPqy
rowAtSd3lX0/7bbQeu8vWA2AQoK9x3sfuXA2N5hJALSNRIs2j3d9NRer90Y=
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDVyEutVio9FSAZ

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo
@@ -43,6 +43,7 @@ CPhk+BqvxjzX1v2dkmVQCu4Jefy43knX10RyE23G6fTWncL2aXREb0CZ73lOT/AL
K6dA+91oqeMSXMl4TVzNOeky
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
MIIDWDCCAkCgAwIBAgIRAI2i+HeFYlzMzS0ud+ck2QYwDQYJKoZIhvcNAQELBQAw
GTEXMBUGA1UEAwwOd3d3LkZyZWVWUE4uaXQwHhcNMTkxMDA2MDYzMzM4WhcNMjkx
@@ -63,6 +64,7 @@ vFqPDEpGHH+BEnK6FB7l9QBjDIj7quSJs4VHgSpmvzqoORjU+DlXA/ryQQjZEmG5
z7gR3YzOFgio+Ie5MyQxuJ/ijMNV/M4T0I7Oa2XtLBIOIQMuc08wbib/nKnOtPqy
rowAtSd3lX0/7bbQeu8vWA2AQoK9x3sfuXA2N5hJALSNRIs2j3d9NRer90Y=
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDVyEutVio9FSAZ

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo
@@ -43,6 +43,7 @@ CPhk+BqvxjzX1v2dkmVQCu4Jefy43knX10RyE23G6fTWncL2aXREb0CZ73lOT/AL
K6dA+91oqeMSXMl4TVzNOeky
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
MIIDWDCCAkCgAwIBAgIRAI2i+HeFYlzMzS0ud+ck2QYwDQYJKoZIhvcNAQELBQAw
GTEXMBUGA1UEAwwOd3d3LkZyZWVWUE4uaXQwHhcNMTkxMDA2MDYzMzM4WhcNMjkx
@@ -63,6 +64,7 @@ vFqPDEpGHH+BEnK6FB7l9QBjDIj7quSJs4VHgSpmvzqoORjU+DlXA/ryQQjZEmG5
z7gR3YzOFgio+Ie5MyQxuJ/ijMNV/M4T0I7Oa2XtLBIOIQMuc08wbib/nKnOtPqy
rowAtSd3lX0/7bbQeu8vWA2AQoK9x3sfuXA2N5hJALSNRIs2j3d9NRer90Y=
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDVyEutVio9FSAZ

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
<ca>

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
<ca>

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
<ca>

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
<ca>

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -16,7 +16,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

View File

@@ -17,7 +17,7 @@ auth SHA256
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
redirect-gateway
setenv opt block-outside-dns
script-security 2
;comp-lzo

42
openvpn/updateFreeVPN.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
# Usage:
# docker exec -it -w / **CONTAINER** bash -c "./etc/openvn/updateFreeVPN.sh"
DIR="/tmp/freevpn"
TARGET="/etc/openvpn/freevpn"
ZIP_FILE="/tmp/freevpn.zip"
URL=`curl -s https://freevpn.me/accounts/`
REGEX='<a +.*href="(https:.*\.zip)"'
# Download FreeVPN Zip file
[[ $URL =~ $REGEX ]] && curl -s ${BASH_REMATCH[1]} -o ${ZIP_FILE}
# Unzip file
unzip -qo ${ZIP_FILE} -d $DIR
# Create directory if not exits
if [[ ! -d "$DIR" ]]
then
mkdir $DIR
fi
# Process content file
IFS=$'\n'
for i in $(find ${DIR} -name "*.ovpn")
do
sed -i 's/route 0.0.0.0 0.0.0.0/redirect-gateway/' $i
sed -i 's/auth-user-pass/auth-user-pass \/config\/openvpn-credentials.txt/' $i
if [[ $i == *TCP* ]];
then
sed -i 's/explicit-exit-notify//' $i
fi
file=${i##*/}
file=${file/FreeVPN./}
mv $i ${TARGET}/${file} > /dev/null 2>&1
done
# Delete temporary directory
rm -rf ${DIR}