summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwg-netns-exec11
1 files changed, 9 insertions, 2 deletions
diff --git a/wg-netns-exec b/wg-netns-exec
index 73550e0..3e430c0 100755
--- a/wg-netns-exec
+++ b/wg-netns-exec
@@ -54,6 +54,7 @@ netns=
enable_tap=
tap_addrs=()
dnat_rules=()
+no_check=
while (($#)); do
case "$1" in
-c|--config)
@@ -71,6 +72,9 @@ while (($#)); do
--dnat)
dnat_rules+=("${2}")
shift 2 ;;
+ --no-check)
+ no_check=1
+ shift ;;
--dry-run)
DRY_RUN=1
shift ;;
@@ -217,8 +221,11 @@ run wg-quick strip "${wg_conf}" |
run ip -n "${netns}" link set "${wg_if}" up
run ip -n "${netns}" -4 route add default dev "${wg_if}"
run ip -n "${netns}" -6 route add default dev "${wg_if}"
-run ip netns exec "${netns}" curl -s4 -m 10 ifconfig.co
-run ip netns exec "${netns}" curl -s6 -m 10 ifconfig.co
+
+if ((!no_check)); then
+ run ip netns exec "${netns}" curl -4 -m 10 ifconfig.co
+ run ip netns exec "${netns}" curl -6 -m 10 ifconfig.co
+fi
if ((enable_tap)); then
run ip netns exec "${netns}" ip tuntap add dev tap0 mode tap user \