will traceroute work for this?

hello all-
I am soon to convert a large scale ftp server and my problem is this. There are currently over 50,000 ftp profiles (each one within an individual file) that I need to determine which of the 2 interfaces it is traveling to get to its destination.
My plans were that I will loop thru individual files (a profile containing all of the ftp information for one transmission), within the file I read in a parm named ADDRESS="someipaddress", issue a traceroute command against the address. If I see within the traceroute the first hop going 192.168.1.1 then I can assume that it travels the internal interface however if I see the first hop as 191.144.1.1, then I know this an 'external' ftp. For everyone that I identify as and 'internal' FTP, I will (within the file) change a parm called RESOURCE=FTP to be RESOURCE=FTP_INT) and each that I identify as 'external will change from RESOURCE=FTP to RESOURCE=FTP_EXT.

I know there is a lot of very sharp individuals monitoring this site and I was wondering is there a better way to determine which NIC a ftp is traveling than a traceroute command? Will my idea even work? Might I get some sample code for the traceroute piece?

Thanks in advance for your help!

I would think that you should have a list of your internet ip address ranges. It might be as simple as "is the address 192.168.*.*".

I don't fully understand.

You should not need to do a traceroute. You can determine the information you need from your routing table and search files based on this information.

What routing protocol are you running? Or, as I suspect, are you simply static routing?