Guest User

Untitled

a guest
Oct 21st, 2019
110
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # Script is used to set the Nameserver Lookup under Max OS X 10.4 with the Console
  4. # Script by Stephan Oeste <stephan@oeste.de>
  5.  
  6. if [ $# -lt 2 ] ; then
  7. echo "Use: $0 <domain> <1.Nameserver> [2.Nameserver]"
  8. echo "Example Use: $0 example.tld 1.2.3.4 1.2.3.5"
  9. exit 1
  10. fi
  11.  
  12. PSID=$( (scutil | grep PrimaryService | sed -e 's/.*PrimaryService : //')<< EOF
  13. open
  14. get State:/Network/Global/IPv4
  15. d.show
  16. quit
  17. EOF
  18. )
  19.  
  20. scutil << EOF
  21. open
  22. d.init
  23. d.add ServerAddresses * $2 $3
  24. d.add DomainName $1
  25. set State:/Network/Service/$PSID/DNS
  26. quit
  27. EOF
RAW Paste Data