home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
bos225b2.zip
/
logresolv.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-09-09
|
1KB
|
52 lines
/*
* Resolv IP addresses in logfile
* REXX script written by Michael Reinsch <mr@uue.org>
*
* this is freeware - NO WARRANTY.
*
* it requires: host.exe
* rxqueue.exe
*
* recommanded: emxload.exe from EMX dev. package to load host.exe
* (simply remove 'emxload host' in the script if you don't have it)
*/
parse arg infile outfile
'@echo off'
if infile = '' | outfile = '' then do
say 'syntax: logresolv.cmd <in-logfile> <out-logfile>'
return 1
end
'rxqueue /clear'
'emxload host'
do while Lines(infile)
line = LineIn(infile)
parse var line ip entry
parse var ip x1 '.' x2 '.' x3 '.' x4
if DataType(x1, 'Number') & DataType(x2, 'Number') & DataType(x3, 'Number') & DataType(x4, 'Number') then do
call CharOut, 'resolving ' ip
if cache.x1.x2.x3.x4 \= 'CACHE.'x1'.'x2'.'x3'.'x4 then
hostname = cache.x1.x2.x3.x4
else do
'host' ip ' | rxqueue /fifo'
test = LineIn("QUEUE:")
parse var test ip2 ' = ' hostname
cache.x1.x2.x3.x4 = hostname
end
if hostname \= '' then do
say ' =>' hostname
ip = hostname
end
else
say ' - not found'
end
else
say 'not resolving:' ip
call LineOut outfile, ip entry
end