home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / get-ip1a.zip / ppdxit.cmd < prev   
OS/2 REXX Batch file  |  1996-12-27  |  3KB  |  84 lines

  1. /*REXX*/
  2. /*What started out to be a simple little script to write a file containing my IP address turned out to be quite the project. :) 
  3.  
  4. Many Thanks to Don Russell for helping me out with this script.
  5.  
  6. 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. 
  7.  
  8. 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.
  9.  
  10. 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.
  11.  
  12. This is my first attempt at REXX and I am sure there is a better and faster way to accomplish this. :)
  13.  
  14. The latest release will be available at http://www.rdrop.com/~fn448
  15.  
  16. Enjoy, CyberLord*/
  17.  
  18.  
  19. parse upper source env how self .
  20.  
  21. ConnectSpeed = Arg(1)
  22.  
  23. address cmd '@ECHO OFF'
  24.  
  25. if how = 'FUNCTION' then do
  26.    Say 'GET-IP Script by CyberLord@Cyber-Wizard.com'
  27.    Say 'Copyright 1996 Timothy Millea'
  28.    /* we were started as a function call from pppdial... */
  29.    /* start us again as a separate session and return. */
  30.    /* /c to close window when finished, and passing ConnectSpeed again.*/
  31.    'START /C /I' self ConnectSpeed
  32.    return 0 /*return to pppdial.cmd*/
  33. end
  34.  
  35. /* The user exit actually ended but hasn't done anything yet... */
  36. /* It started up the program again asynchronously in order to let the dial */
  37. /* connection be completed.... */
  38.  
  39. /* Let's wait a few seconds to let the Dialer Program finish up*/
  40. call SysSleep 3
  41.  
  42. /*Now we can continue to do what we set out to do*/
  43. /* This program assumes that a connection to TCP/IP has already    */
  44. /* been established before its execution.                          */
  45.  
  46. /* What's our IP address this time? ... */
  47.  
  48. 'NETSTAT -a | RXQUEUE'
  49. parse pull . MyIP .
  50.  
  51. /*Open ipadr.doc and write the goodies to it*/
  52. /*ipadr.doc is created in your root dir on the drive that your tcpip dir is on*/
  53.  
  54. fileout = 'ipadr.doc'
  55.  
  56. /*open file at begining to overwrite any info there, the ,1 at the end does that*/
  57.  
  58. call LINEOUT fileout, 'GET-IP Script by CyberLord@Cyber-Wizard.com',1
  59. call lineout fileout, 'Copyright 1996 Timothy Millea'
  60. call LINEOUT fileout, ''
  61. call LINEOUT fileout, 'My IP address is : 'MyIP
  62. call lineout fileout, 'Connected at : 'ConnectSpeed
  63.  
  64.  
  65. /*OK, now put in the programs you want started below here*/
  66. /*You will need to edit or comment this section out to suit your needs*/
  67.  
  68. Say 'Starting Mail Program'
  69. /*Change directory to mail program so program can find it's startup files etc.*/
  70. cd '\programs\mail'
  71. /*start mail program*/
  72. 'start mail.exe'
  73. Say 'Starting FTP Daemon'
  74. /*Change directory to FTPD so it can find it's startup files*/
  75. cd '\programs\ftpd'
  76. /*Start the FTP Daemon*/
  77. 'start' 'ftpd.exe'
  78. /*Hey, may as well let who is Fingering me via E-Mail know my FTP server is up :)*/
  79. call LINEOUT fileout, ''
  80. call LINEOUT fileout, 'FTP Daemon (Server) up and running'
  81.  
  82. call LINEOUT fileout /*close file*/
  83. exit 0
  84.