Created
June 18, 2020 17:26
-
-
Save mostafabahri/115d4473b0ab7b187e5d35b0972c46de to your computer and use it in GitHub Desktop.
Shecan.ir script
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
shecan(){ | |
# dns config file | |
conf=/etc/resolv.conf | |
downNames=$(cat << EOF | |
nameserver 8.8.4.4 | |
nameserver 8.8.8.8 | |
EOF | |
) | |
upNames=$(cat << EOF | |
# shecan servers | |
nameserver 178.22.122.100 | |
nameserver 185.51.200.2 | |
EOF | |
) | |
# status flag | |
if [[ $1 = "-s" ]]; then | |
cat $conf; | |
return; | |
fi | |
# deactivate flag | |
if [[ $1 = "-d" ]]; then | |
echo $downNames | sudo tee $conf && echo "shecan off."; | |
# activate (no flag) | |
else | |
echo $upNames| sudo tee $conf && echo "shecan on!"; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment