Skip to content

Instantly share code, notes, and snippets.

@ervinb
Last active June 3, 2016 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ervinb/511cd93e7292b874a211ffe06fd24d2e to your computer and use it in GitHub Desktop.
Save ervinb/511cd93e7292b874a211ffe06fd24d2e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
sudo bash -c 'echo -e "net.ipv6.conf.all.disable_ipv6 = 1\nnet.ipv6.conf.default.disable_ipv6 = 1\nnet.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf'
sudo sysctl -p &>/dev/null
disabled=$(cat /proc/sys/net/ipv6/conf/all/disable_ipv6)
[ $disabled == 1 ] && echo "IPv6 disabled" || echo "IPv6 is enabled"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment