Bash function for automatic DNS activation of shecan.ir site
shecan() {
local current_dns_state=$(scutil --dns | grep "178.22.122.100" | awk '{print $3}')
if [ "$current_dns_state" != "" ]; then
echo "YOUR_PASSWORD" | sudo -S networksetup -setdnsservers Wi-Fi Empty
echo "DNS has been disabled."
else
echo "YOUR_PASSWORD" | sudo -S networksetup -setdnsservers Wi-Fi 178.22.122.100 185.51.200.2
echo "DNS has been enabled."
fi
}