Skip to content

Instantly share code, notes, and snippets.

@mold
Created December 7, 2015 22:52
Show Gist options
  • Save mold/76734f66b1aa48eb5951 to your computer and use it in GitHub Desktop.
Save mold/76734f66b1aa48eb5951 to your computer and use it in GitHub Desktop.
Set DNS to TVUnblock servers
#!/bin/bash
if [ $UID -ne 0 ] ; then
printf "Usage: sudo ./tvunblock.sh\n"
exit
fi
SERVERS="nameserver 46.101.149.135\nnameserver 46.101.36.120"
OLD="$(cat /etc/resolv.conf)"
printf "Old resolv.conf:\n${OLD}\n\n"
echo "${SERVERS}" > /etc/resolv.conf
printf "New resolv.conf:\n$(cat /etc/resolv.conf)\n\n"
read -n1 -r -p "Press any key to reset..."
printf "${OLD}" > /etc/resolv.conf
printf "\nresolv.conf reset to:\n$(cat /etc/resolv.conf)\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment