Last active
August 20, 2017 19:19
-
-
Save Freccia/74de11cea940b2a559a7f67e4d3e682f to your computer and use it in GitHub Desktop.
Disable ipv6 globally on OS X
This file contains hidden or 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
#!/bin/bash | |
######################### | |
# written by freccia # | |
# 29.06.2017 # | |
# Disables ipv6 on OS X # | |
######################### | |
# This script checks for interfaces actually up | |
# then it disables ipv6 on these | |
CYAN="\033[36m" | |
ENDC="\033[0m" | |
IFACES="`networksetup -listallnetworkservices`" | |
count=0 | |
while read -r iface; do | |
if [[ count -ne 0 ]];then | |
echo -e "Disabling ipv6 for $CYAN $iface $ENDC ..." | |
networksetup -setv6off "$iface" | |
networksetup -getinfo "$iface" | |
echo | |
fi | |
count=$((count+1)) | |
done <<< "$IFACES" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment