Skip to content

Commit

Permalink
reconnect within the same container to avoid issue #28
Browse files Browse the repository at this point in the history
  • Loading branch information
Julio Gutierrez committed Apr 6, 2019
1 parent fd759f7 commit 2b3555f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ The container is as simple as it can be, in order to reconnect automatically whe
* `NET_IFACE` - Network Interface to bind the vpn (Useful when combined with `--network host` to protect the entire host).

# Versions
* **2019.04.06**
- Fix reconnect mechanism [#28](https://github.com/bubuntux/nordvpn/issues/28).
* **2019.03.12**
- Remove HEALTH_CHECK.
* **2019.03.09**
Expand Down
4 changes: 2 additions & 2 deletions hooks/post_checkout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

DOCKER_VERSION=18.09.2
DOCKER_MD5SUM=38e8e8db37bfb453a050ead4d447aaa3
DOCKER_VERSION=18.09.4
DOCKER_MD5SUM=17a327d2871874892b3b3d7532d7975c

echo "**** Updating docker ****"
curl "https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz" | gunzip | tar -x --strip-components 1 docker/docker
Expand Down
15 changes: 10 additions & 5 deletions nordVpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,18 @@ else
firewall

ovpn_dir=$(download_ovpn)
config_file=$(select_config_file ${ovpn_dir})

mkdir -p /dev/net
[[ -c /dev/net/tun ]] || mknod -m 0666 /dev/net/tun c 10 200

echo "Connecting $([[ -n ${OPENVPN_OPTS} ]] && echo "( ${OPENVPN_OPTS} )")... "
exec sg vpn -c "openvpn --config ${config_file} --auth-user-pass ${auth_file} --auth-nocache \
--script-security 2 --up /etc/openvpn/up.sh --down /etc/openvpn/down.sh \
${OPENVPN_OPTS}"
while :; do
config_file=$(select_config_file ${ovpn_dir})
echo "Connecting ... "
set -x
exec sg vpn -c "openvpn --config ${config_file} --auth-user-pass ${auth_file} --auth-nocache \
--script-security 2 --up /etc/openvpn/up.sh --down /etc/openvpn/down.sh \
${OPENVPN_OPTS}"
set +x
sleep 1
done
fi

0 comments on commit 2b3555f

Please sign in to comment.