I need to mount shares when I am connected to the main wireless connection here at home. So I wrote a quick ruby script that will do this based on your network name, and mount the shares you have listed.
#!/usr/bin/ruby
# network name to automount on
mnt_network = "network-name"
# share names to mount
# mnt_shares["SHARE-NAME"] = "afp://USER:PASSWORD@IP/SHARE_NAME"
mnt_shares = Hash.new
mnt_shares["backups"] = "afp://eric:password@10.1.1.2/backups"
#mnt_shares["music"] = "afp://music:music@10.1.1.2/music"
network = `system_profiler SPAirPortDataType | grep -e "Current Wireless Network:"`
network = network.sub(/Current Wireless Network: /, "").strip
mnt_shares.each { |share_name,location|
`cd /Volumes; mkdir #{share_name}; mount -t afp #{location} #{share_name} >> /dev/null 2>&1`
}chmod u+x /usr/local/bin/auto_mount_sharessudo defaults write com.apple.loginwindow \
LoginHook /usr/local/bin/auto_mount_shares
[robg adds: I haven't tested this one...]
Mac OS X Hints
http://hints.macworld.com/article.php?story=2006032410332154