Hey, it's been about 8 years since I last wrote a BASH script and I could use some quick help. Specifically I've forgotten how to write proper if comparison statements for program output. Essentially this is psuedocode of what I need:
if <output of 'networksetup -getdnsservers Wi-Fi'> = '208.122.23.22\n 208.122.23.23'
networksetup -setdnsservers Wi-Fi empty
else
networksetup -setdnsservers Wi-Fi 208.122.23.22 208.122.23.23
I can't for the life of me remember how to correctly script that comparison in bash. It should be a stupid simple line so any help that can be offered is greatly appreciated.
I'm trying to quickly toggle between automatic and two set DNS servers in OS X and it seems to me a script is the easiest way.
Look at our friendly members:
MX7 wrote:I'm not a fan of a racist, gun nut brony puking his odious and uninformed arguments over every thread that comes up.