Created
February 17, 2017 19:54
-
-
Save Morozov-5F/582fc08138d14bb653a250ba2732a081 to your computer and use it in GitHub Desktop.
Script to bypass rutracker block for macOS. Uses DNS servers from portaller service.
This file contains 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 | |
if [[ $(whoami) != 'root' ]] | |
then | |
echo "You should be a super-user to run this script" | |
exit 1 | |
fi | |
function down() | |
{ | |
echo "Removing existing DNS servers. . ." | |
networksetup -setdnsservers Wi-Fi "empty" | |
echo "All good!" | |
} | |
function up() | |
{ | |
echo "Setting new DNS servers. . ." | |
networksetup -setdnsservers Wi-Fi 107.170.15.247 77.88.8.8 | |
echo "All good!" | |
} | |
case "$1" in | |
down) | |
down | |
;; | |
up) | |
up | |
;; | |
*) | |
echo "Usage: $0 {up|down}" | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment