My workplace has several security policies that run counter to how I would usually set up my laptop. In particular, when connected to the network at work, we are forbidden from having an ssh daemon accepting connections. This generally leads to me getting in trouble at work (when I forget to shut down the sshd) or being unable to access my laptop remotely when it's not at work (when I forget to bring it back up), so I would like to automate this process.
Is there a way to automatically change the firewall rules or stop/start the sshd service depending on the SSID of the wifi network I am connected to? I am running CentOS6 if it makes a difference.