Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- # make-dns 1.0 - switches between default & alternative DNS (CyberGhost) to bypass legal shit.
- ERROR(){
- printf "\033[31mERROR! $1 argument. Must be either ON or OFF.\033[0m\n"
- exit 1
- }
- EDIT(){
- [ "$(id -u)" -eq 0 ] || exec sudo sh "$0" $1
- chattr -i /etc/resolv.conf
- printf "$CONTENT" > /etc/resolv.conf
- chattr +i /etc/resolv.conf
- echo "Done - DNS server set $2."
- }
- if [ $# -gt 0 ]; then
- if [ "$1" = "on" ] || [ "$1" = "ON" ]; then
- CONTENT="# Generated by NetworkManager
- #search fritz.box
- #nameserver 192.168.178.1
- #nameserver fd00::f2b0:14ff:fe67:ea25\n
- #CyberGhost
- nameserver 38.132.106.139
- nameserver 194.187.251.67\n"
- EDIT $1 "to CyberGhost"
- elif [ "$1" = "off" ] || [ "$1" = "OFF" ]; then
- CONTENT="# Generated by NetworkManager
- search fritz.box
- nameserver 192.168.178.1
- nameserver fd00::f2b0:14ff:fe67:ea25\n
- #CyberGhost
- #nameserver 38.132.106.139
- #nameserver 194.187.251.67\n"
- EDIT $1 "back to default"
- else
- ERROR "Wrong"
- fi
- else
- ERROR "No"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement