Script Wi-Fi SSID switch if on SSID "X"
Test ([) if the output of networksetup is the same as the string CompanyA if so then change the SSID to CompanyB.

curssid=$(networksetup -getairportnetwork en0 | cut -d ' ' -f4-)

if [ "$curssid" = CompanyA ]
then
networksetup -setairportnetwork en0 "CompanyB"
fi