Mac OSX Shell Script to automate connecting to WiFi network

I have a Mac laptop running ‘Snow Leopard’ that occasionally will not connect to my home WiFi, even though other devices are connected to the network just fine.

I wrote a small shell script that uses the networksetup command to reset AirPort. If WiFi is still not connected, the script tries to assign the AirPort WiFi network directly. If that doesn’t work, it just resets AirPort again.
Continue reading “Mac OSX Shell Script to automate connecting to WiFi network”