Multiple WIFI connections on Beaglebone black

I just got my beaglebone black to automatically connect to my WiFi at home as part of its boot up. It was not that difficult i just wrote a program that has my homes SSID and PASSKEY in it and it connects. My question is, is there a way to make it connect to multiple WIFI spots such as at another house without having to go in and change the program all around each time? Is there a way to have it try to recognize one WiFi and if it can not, try to recognize another until it finds the right one?