/*What started out to be a simple little script to write a file containing my IP address turned out to be quite the project. :)
Many Thanks to Don Russell for helping me out with this script.
For this REXX script to function properly, it needs to be called from Don Russells pppdial ver 3.0. This new version allows for a call to a user function, such as this program.
A minor change can be made to Don's pppdial.cmd file to pass the ActualCarrier speed along to this script so it can also be written out to a file along with the IP address.
So what good is this REXX script? Well, say you have these friends, and they all wanted to connect to your machine for whatever reasons, chat, FTP, Telnet, etc., and you don't want to have to write to all of them each time your IP changes. This little script along with a mail program that handles filters and templates will accomplish that for you.
This is my first attempt at REXX and I am sure there is a better and faster way to accomplish this. :)
The latest release will be available at http://www.rdrop.com/~fn448
Enjoy, CyberLord*/
parse upper source env how self .
ConnectSpeed = Arg(1)
address cmd '@ECHO OFF'
if how = 'FUNCTION' then do
Say 'GET-IP Script by CyberLord@Cyber-Wizard.com'
Say 'Copyright 1996 Timothy Millea'
/* we were started as a function call from pppdial... */
/* start us again as a separate session and return. */
/* /c to close window when finished, and passing ConnectSpeed again.*/
'START /C /I' self ConnectSpeed
return 0 /*return to pppdial.cmd*/
end
/* The user exit actually ended but hasn't done anything yet... */
/* It started up the program again asynchronously in order to let the dial */
/* connection be completed.... */
/* Let's wait a few seconds to let the Dialer Program finish up*/
call SysSleep 3
/*Now we can continue to do what we set out to do*/
/* This program assumes that a connection to TCP/IP has already */
/* been established before its execution. */
/* What's our IP address this time? ... */
'NETSTAT -a | RXQUEUE'
parse pull . MyIP .
/*Open ipadr.doc and write the goodies to it*/
/*ipadr.doc is created in your root dir on the drive that your tcpip dir is on*/
fileout = 'ipadr.doc'
/*open file at begining to overwrite any info there, the ,1 at the end does that*/
call LINEOUT fileout, 'GET-IP Script by CyberLord@Cyber-Wizard.com',1