1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool/travis_disable_ipv6.sh
Jun Aruga f132825ffa Disable IPv6 on Travis s390x case. (#2819)
This fixes following error that sometimes happens once in a few times
on Travis s390x environment.

```
$ tool/travis_retry.sh sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
+ sudo -E apt-add-repository -y ppa:ubuntu-toolchain-r/test
Error: retrieving gpg key timed out.
```
2020-01-07 12:23:04 +09:00

11 lines
319 B
Bash
Executable file

#!/bin/bash
set -ex
ip a
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
ip a
cat /etc/hosts
sudo ruby -e "hosts = File.read('/etc/hosts').sub(/^::1\s*localhost.*$/, ''); File.write('/etc/hosts', hosts)"
cat /etc/hosts