replace dynamic ip address in html file with new address

replace dynamic ip address in html file with new address

Post by David Doug » Sun, 01 Dec 1996 04:00:00



First question is:

How can I insert my dynamic ip address from a file called 'add' that has only
my ip address in it into the line below where it says NOT.ON.LINE.NOW
How can I replace my

<p>My current IP address is &lt;<B><I>NOT.ON.LINE.NOW</B></I>&gt;</p>
<p>Last automatic update: <B><I><$DateTime></B></I></p>

Next question is:
Once I insert my ip address into the above line, how do I replace the address
with another address.

<p>My current IP address is &lt;<B><I>206.3.12.2</B></I>&gt;</p>

I need a replace type command such as: replace $1 with $2.

I found this in the sed man page but I don't know how to go about using it

[2addr]y/string1/string2/
             Replace all occurrences of characters in string1 in the pattern
             space with the corresponding characters from string2. Any charac-
             ter other than a backslash or newline can be used instead of a
             slash to delimit the strings.  Within string1 and string2, a
             backslash followed by any character other than a newline is that
             literal character, and a backslash followed by an ``n'' is re-
             placed by a newline character.

 
 
 

replace dynamic ip address in html file with new address

Post by Icarus Spar » Sun, 01 Dec 1996 04:00:00




>First question is:

>How can I insert my dynamic ip address from a file called 'add' that has only
>my ip address in it into the line below where it says NOT.ON.LINE.NOW
>How can I replace my

><p>My current IP address is &lt;<B><I>NOT.ON.LINE.NOW</B></I>&gt;</p>
><p>Last automatic update: <B><I><$DateTime></B></I></p>

>Next question is:
>Once I insert my ip address into the above line, how do I replace the address
>with another address.

I would suggest that you would best be suited by having 2 copies of the file,
the 'current' one and the 'master' one. You can then say

sed 's/NOT.ON.LINE.NOW/'`cat add`'/g' master > current.html

Icarus

 
 
 

replace dynamic ip address in html file with new address

Post by Brian S Hil » Wed, 04 Dec 1996 04:00:00




: : First question is:
: : How can I insert my dynamic ip address from a file called 'add'
: : that has only my ip address in it into the line below where it
: : says NOT.ON.LINE.NOW
: : How can I replace my
: : <p>My current IP address is &lt;<B><I>NOT.ON.LINE.NOW</B></I>&gt;</p>
: : <p>Last automatic update: <B><I><$DateTime></B></I></p>

: I would suggest that you would best be suited by having 2 copies of the file,
: the 'current' one and the 'master' one. You can then say
: sed 's/NOT.ON.LINE.NOW/'`cat add`'/g' master > current.html

Nope; the one character that can be guaranteed to be in an html file is the
forward slash.

<p>My current IP address is &lt;<B><I>NOT.ON.LINE.NOW</B></I>&gt;</p>
<p>Last automatic update: <B><I><$DateTime></B></I></p>

sed '/NOT\.ON\.LINE\.NOW/ a\
FFF.FFF.FFF.FFF
' add >add.new
#mv add.new add

: : Next question is:
: : Once I insert my ip address into the above line, how do
: : I replace the address with another address.

sed '/NOT\.ON\.LINE\.NOW/ {
        N
        s/[0-9]\{3\}\.[0-9]\{3\}\.[0-9]\{3\}\.[0-9]\{3\}/FFF.FFF.FFF.FFF/

Quote:}' add >add.new

#mv add.new add

-Brian
--
   ,---.     ,---.     ,---.     ,---.     ,---.     ,---.     ,---.  
  /  _  \   /  _  \   /  _  \   /  _  \   /  _  \   /  _  \   /  _  \  

__,'   `.___,'   `.___,'   `.___,'   `.___,'   `.___,'   `.___,'   `.__

 
 
 

1. dynamic ip address - how to get to know my ip address?

Hi there,

my ISP provides me with a dynamic ip address. I'm using a wireless LAN
router made by SMC to connect to the internet. I want to get to know the
public ip address from a computer that is located in the local network
behind the router's firewall. But, of course, the router's NAT replaces the
public ip address with the local one.

How do I get to know the public ip address the ISP gave me?

Currently, I'm not using Linux. But I consider to set up a Linux box that
will be accessible from the internet. I guess, this problem is not
platform-dependent. Unfortunately, my router does not have a telnet
interface or any other interface that would provide me with the public ip
address. Only, if login to the web interface manually, I can see the current
status including the current ip address.

Can I solve this problem with standard TCP/IP tools? "ping" does not give
any evidence -- I was sniffing with Ethereal to miss no information.

Do I need help from an external system that can tell me my ip address? Is
there a service, I can use?

Thanks in advance,

Johannes

2. Redhat 4.1 Kernal Modules

3. Script to create HTML doc w/Dynamic IP address in it.

4. Setting up CGI on server

5. new IP address for the same MAC address

6. LILO Boot Trouble

7. New to Networking: WinNT network, Dynamic IP addressing, Passwords..?

8. SMTP behind proxy

9. Script to update dynamic DNS every time cablemodem gets a new IP address?

10. Changing IP address on Solaris 9 with multiple virtual IP addresses

11. WANTED: pingmac <IP ADDR> which returns <MAC ADDRESS of IP ADDRESS>

12. IP Masquerading with IP Address and Mac Address Restrictions

13. FTPing large file with dynamic IP address