I have a laptop that is a road warrior and am always changing networks.

At home I have a server setup for filesharing and have to enter a command (I made it a keyboard shortcut) each time I connect to the network.

Is there any way that once I connect to my home wireless network I have the command execute upon successful connection to the network?