I'm stuck on a script to switch a Mac to a different SSID if its already connected to a certain SSID.
What I need the script to do is:
Check what SSID the Mac Wi-Fi is using
If it is on SSID called "CompanyA" switch to SSID called "CompanyB" If it is not on SSID called "CompanyA" do nothing.
I can get SSID currently connected to with
networksetup -getairportnetwork en0 | cut -d ":" -f2
and I can switch with
networksetup -setairportnetwork en0 "CompanyB"
But I don't know how to do the if on CompanyA then switch to CompanyB