-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from tmknight/testing
Merge of testing in preparation for release 1.5.0
- Loading branch information
Showing
8 changed files
with
120 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
[[ -n ${WHITELIST} && -z ${BYPASS_LIST} ]] && BYPASS_LIST=${WHITELIST} | ||
if [[ -n ${BYPASS_LIST} ]] | ||
then | ||
gw="$(ip route | awk '/default/{print $3}')" | ||
for domain in ${BYPASS_LIST//[;,]/ } | ||
do | ||
domain=$(echo "$domain" | sed 's/^.*:\/\///;s/\/.*$//') | ||
echo -e $(date "+%F %T%z") "\tINFO\tEnabling unsecured connection to host '${domain}'" | ||
## set iptables | ||
iptables -A OUTPUT -o eth0 -d "${domain}" -j ACCEPT # 2>/dev/null | ||
[[ -n $(dockerNetworks6) ]] && ip6tables -A OUTPUT -o eth0 -d "${domain}" -j ACCEPT # 2>/dev/null | ||
## route IPs to eth0 | ||
ips=$(dig +short $domain | sed 's/^.*:\/\///;s/\/.*$//') | ||
for ip in $ips | ||
do | ||
ip route | grep -q "$ip" || ip route add $ip via $gw dev eth0 | ||
done | ||
done | ||
fi |
Oops, something went wrong.