summaryrefslogtreecommitdiff
path: root/tool/disable_ipv6.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tool/disable_ipv6.sh')
-rwxr-xr-xtool/disable_ipv6.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tool/disable_ipv6.sh b/tool/disable_ipv6.sh
new file mode 100755
index 0000000000..ce1cc0da68
--- /dev/null
+++ b/tool/disable_ipv6.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -ex
+sysctl -w net.ipv6.conf.all.disable_ipv6=1
+sysctl -w net.ipv6.conf.default.disable_ipv6=1
+sysctl -w net.ipv6.conf.lo.disable_ipv6=1
+
+cat /etc/hosts
+ruby -e "hosts = File.read('/etc/hosts').sub(/^::1\s*localhost.*$/, ''); File.write('/etc/hosts', hosts)"
+cat /etc/hosts