Skip to content

Instantly share code, notes, and snippets.

@Morozov-5F
Created February 17, 2017 19:54
Show Gist options
  • Save Morozov-5F/582fc08138d14bb653a250ba2732a081 to your computer and use it in GitHub Desktop.
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.
#!/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