Skip to content

Commit

Permalink
revert whitelist fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Julio Gutierrez committed Jul 1, 2021
1 parent bbfd471 commit 7e3cff6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions start_vpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ if [[ -n ${docker6_network} && -n ${NETWORK6} ]]; then
done
fi

if [[ -n ${WHITELIST} ]]; then
for domain in ${WHITELIST//[;,]/ }; do
domain=$(echo "$domain" | sed 's/^.*:\/\///;s/\/.*$//')
echo "[$(date -Iseconds)] Enabling connection to host ${domain}"
sg nordvpn -c "iptables -A OUTPUT -o eth0 -d ${domain} -j ACCEPT"
sg nordvpn -c "ip6tables -A OUTPUT -o eth0 -d ${domain} -j ACCEPT 2>/dev/null"
done
fi

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

Expand Down Expand Up @@ -186,15 +195,6 @@ connect() {
connect
[[ -n ${DEBUG} ]] && tail -n 1 -f /var/log/nordvpn/daemon.log &

if [[ -n ${WHITELIST} ]]; then
for domain in ${WHITELIST//[;,]/ }; do
domain=$(echo "$domain" | sed 's/^.*:\/\///;s/\/.*$//')
echo "[$(date -Iseconds)] Enabling connection to host ${domain}"
iptables -A OUTPUT -o eth0 -d "${domain}" -j ACCEPT
ip6tables -A OUTPUT -o eth0 -d "${domain}" -j ACCEPT 2>/dev/null
done
fi

cleanup() {
nordvpn status
nordvpn disconnect
Expand Down

0 comments on commit 7e3cff6

Please sign in to comment.