It sounds like you have 'connect on startup' enabled in the options, disable this. It also sounds like you're using the -m switch in all /server lines. Don't use -m on the first.
To identify you use the connect event
on *:connect:{
if ($network == XXX) { ... }
elseif ($network == YYY) { ... }
}