Skip to content

Instantly share code, notes, and snippets.

@wwwjfy
Created July 28, 2013 15:20
Show Gist options
  • Save wwwjfy/6098936 to your computer and use it in GitHub Desktop.
Save wwwjfy/6098936 to your computer and use it in GitHub Desktop.
Set dns to 127.0.0.1 after Astrill connected
#!/bin/bash
adapter=$(echo "show Setup:/Network/Astrill" | scutil | sed -n '/Adapter/ s/^.*Adapter : \(.*\)/\1/ p')
sudo scutil <<EOF
open
d.init
d.add ServerAddresses * 127.0.0.1
set Setup:/Network/Service/$adapter/DNS
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment