Skip to content

Instantly share code, notes, and snippets.

@sajaddp
Created May 7, 2023 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajaddp/f56220e736a29d38a48f7e10ffe3fd75 to your computer and use it in GitHub Desktop.
Save sajaddp/f56220e736a29d38a48f7e10ffe3fd75 to your computer and use it in GitHub Desktop.
Bash function for automatic DNS activation of 403.online site

Bash function for automatic DNS activation of 403.online site

403() {
  local current_dns_state=$(scutil --dns | grep "10.202.10.102" | 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 10.202.10.102 10.202.10.202
    echo "DNS has been enabled."
  fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment