Skip to content

Commit

Permalink
README.md openvpn.sh add option to specify 'tcp' as the protocol, fix d…
Browse files Browse the repository at this point in the history
  • Loading branch information
David Personette committed Apr 12, 2020
1 parent 2eca251 commit 2761293
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ the second container (that's what `--net=container:vpn` does).
<server> to connect to (multiple servers are separated by :)
<user> to authenticate as
<password> to authenticate with
optional arg: [port] to use, instead of default
optional args:
[port] to use, instead of default
[proto] to use, instead of udp (IE, tcp)

The 'command' (if provided and valid) will be run instead of openvpn

Expand Down
11 changes: 7 additions & 4 deletions openvpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,14 @@ return_route() { local network="$1" gw="$(ip route |awk '/default/ {print $3}')"
# user) user name on VPN
# pass) password on VPN
# port) port to connect to VPN (optional)
# proto) protocol to connect to VPN (optional)
# Return: configured .ovpn file
vpn() { local server="$1" user="$2" pass="$3" port="${4:-1194}" i \
pem="$(\ls $dir/*.pem 2>&-)"
vpn() { local server="$1" user="$2" pass="$3" port="${4:-1194}" proto=${5:-udp}\
i pem="$(\ls $dir/*.pem 2>&-)"

echo "client" >$conf
echo "dev tun" >>$conf
echo "proto udp" >>$conf
echo "proto $proto" >>$conf
for i in $(sed 's/:/ /g' <<< $server); do
echo "remote $i $port" >>$conf
done
Expand Down Expand Up @@ -235,7 +236,9 @@ Options (fields in '[]' are optional, '<>' are required):
<server> to connect to (multiple servers are separated by :)
<user> to authenticate as
<password> to authenticate with
optional arg: [port] to use, instead of default
optional args:
[port] to use, instead of default
[proto] to use, instead of udp (IE, tcp)
The 'command' (if provided and valid) will be run instead of openvpn
" >&2
Expand Down

0 comments on commit 2761293

Please sign in to comment.