On Monday, March 25, 2002 12:55, "Curtis Muncy" <[EMAIL PROTECTED]>
wrote:
>Does anyone have a command line method of asking gnatbox what IP it
>currently is assigned from a DHCP server. I'm using gnatbox with a cable
>modem and would like to setup a script to let me know when my DHCP
>assigned IP has changed.
Use the old Lynx command line browser. The syntax is basically:
lynx -dump -source {URL} >{TEMPFILE}
(Replace the word in the squiggle brackets ({}) with appropriate
values.)
The rest depends on what OS your running the script on. It is pretty simple
(and my preferred solution) in a bourne/korn shell script on a *NIX server.
Add other commands (cut, sed, awk, etc.) in the script to parse the returned
page ({TEMPFILE}). Then schedule in cron to run at your desired intervals.
This should be on the PRO network so you can keep the HTML access turned off
to the EXT side.
I have not done this with the GNATBox but used a similar method of
capturing a web page and pulling out the IP address of another system. I did
this on a Windows based system using Lynx, Cygwin tools, and a DOS batch
file. So it can be done in that environment if *NIX is not available to you.
If not running NT, 2000, or XP you will need a scheduler if you want this to
run automatically at predefined times.
Send me your questions if you need more details.
--
John Stokes
Principal
888 336-0504
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
To subscribe to the digest version first unsubscribe, then
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]