You could use $network to get the network name. And there are plenty of this scripts arround here.
Oh, I see I haven't seen any thou lolol
Oh, I see I haven't seen any thou lolol