In its simplest form:
on opers:TEXT:!connect*:?: .raw CONNECT $2-
Of course, your opers will still have to know which servers go on which hubs or they can just reconnect them to the same hub the leaf just dropped from (assuming you're not wasting time because the leaf already has autoconns set up). Your bot would also have to be globally opered (not such a good idea THERE). The above script will work if your opers are in the userlevel called opers.
/guser opers UserName 3You could specify your default port in the connect command if there is only one that all your servers use.
/connect leaf [port [hub]]like this:
on opers:TEXT:!connect*:?:{
if (*.* iswm $3) .raw CONNECT $2 7878 $3
else .raw CONNECT $2-
}