Recent Changes - Search:

PmWiki

pmwiki.org

edit SideBar

Tidbits

Main.Tidbits History

Hide minor edits - Show changes to markup

April 24, 2006, at 05:07 AM by zeppo -
Changed lines 42-43 from:

?>

to:

?>
You might be able to use http://checkip.dyndns.org:8245/ and clean it up a bit

April 24, 2006, at 05:02 AM by zeppo -
Changed lines 60-63 from:

I put this all together and powered down my DSL modem for 30 minutes, after which it jused another IP.

I rand the above shell script and bingo it worked.

to:

I put this all together and powered down my DSL modem for 30 minutes, after which it just grabbed a new IP.

I ran the above shell script and bingo it worked.

April 24, 2006, at 05:01 AM by zeppo -
Changed lines 21-22 from:
  1. Also works with 'diff', i.e., diff $1 $2 > /dev/null
to:
  1. Also works with 'diff', i.e., diff $1 $2 > /dev/null (or so I read)
April 24, 2006, at 12:58 AM by zeppo -
Changed line 38 from:

On a remote server to display the IP of the the requesting computer I used this

to:

On a remote server to display the IP of the the requesting computer I used this\\

April 24, 2006, at 12:57 AM by zeppo -
Deleted line 38:
April 23, 2006, at 11:09 PM by Zeppo -
Added lines 33-34:

The good thing about the multiple text files is that it gave me insight into which part was failing when it initially didn't work. I could just check each log file to see where the problem was.

April 23, 2006, at 06:13 PM by zeppo -
Changed line 51 from:

lynx -source -auth=NAME:PASSWORD 'http://dynamic.zoneedit.com/auth/dynamic.html?host=virtual-weltanschauung.org' >> /tmp/zone.log

to:

lynx -source -auth=NAME:PASSWORD 'http://dynamic.zoneedit.com/auth/dynamic.html?host=virtual-weltanschauung.org' >> /tmp/dns/zone.log

April 23, 2006, at 04:25 PM by 70.254.171.249 -
Changed line 6 from:
  1. Determin my ip
to:
  1. Determine my ip
Changed lines 17-18 from:

grep -o -f myip2.log dns.log > /tmp/dns/myipck.log

to:

grep -o -f /tmp/dns/myip2.log /tmp/dns/dns.log > /tmp/dns/dnsck.log

Changed line 20 from:

cmp myip2.log myipck.log > /dev/null # /dev/null buries the output of the "cmp" command.

to:

cmp /tmp/dns/myip2.log /tmp/dns/dnsck.log > /dev/null # /dev/null buries the output of the "cmp" command.

Changed lines 25-26 from:
  echo "File \"myip2.log\" is identical to file \"myipck.log\"." >> /tmp/dns/okDNS.log

else

to:
  echo "File \"myip2.log\" is identical to file \"dnsck.log\"." >> /tmp/dns/test.log

else

April 23, 2006, at 01:52 AM by 70.254.171.249 -
Changed lines 46-47 from:

Create a shell script that has this: (A line for each domain name)\\ (zoneed)

to:

Create a shell script that has this: (A line for each domain name)(zoneed)

April 23, 2006, at 01:51 AM by 70.254.171.249 -
Changed line 1 from:

Automatically Updating Dynamic IP for Zoneedit DNS Server dnsck.script \\

to:

Automatically Updating Dynamic IP for Zoneedit DNS Server (dnsck.script) \\

Changed lines 46-47 from:

Create a shell script that has this: (A line for each domain name)\\ zoneed

to:

Create a shell script that has this: (A line for each domain name)\\ (zoneed)

April 23, 2006, at 01:50 AM by 70.254.171.249 -
Changed line 1 from:

Automatically Updating Dynamic IP for Zoneedit DNS Server\\

to:

Automatically Updating Dynamic IP for Zoneedit DNS Server dnsck.script \\

Changed lines 46-47 from:

Create a shell script that has this: (A line for each domain name)\\

to:

Create a shell script that has this: (A line for each domain name)\\ zoneed

April 23, 2006, at 01:49 AM by 70.254.171.249 -
Changed lines 2-3 from:

Put this is in the Cron.Hourly making sure to update and path references

to:

Put this is in the Cron.Hourly making sure to update any path references

Added line 8:
Added line 11:
Added line 15:
Added line 18:
April 23, 2006, at 01:48 AM by 70.254.171.249 -
Changed lines 4-15 from:

[@#!/bin/sh

  1. Determine my ip
  2. You could probably use http://checkip.dyndns.org/ and then somehow strip out the text

lynx -dump "http://www.virtual-weltanschauung.com/t3.php" > myip1.log

  1. Determine current DNS of domain name

ping -c 1 www.virtual-weltanschauung.org | fgrep PING > dns.log

  1. Strip out whitespace of results of myip1.log result then remove extra line

sed 's/^[ \t]*//;s/[ \t]*$//' myip1.log > myip2a.log sed '/^$/d' myip2a.log > myip2.log

to:

[@

  1. !/bin/sh
  2. Determin my ip

lynx -dump "http://www.virtual-weltanschauung.com/t3.php" > /tmp/dns/myip1.log

  1. Determin current DNS of domain name

ping -c 1 www.virtual-weltanschauung.org | fgrep PING > /tmp/dns/dns.log

  1. Strip out whitespace of results of my ip result the remove extra line

sed 's/^[ \t]*//;s/[ \t]*$//' /tmp/dns/myip1.log > /tmp/dns/myip2a.log sed '/^$/d' /tmp/dns/myip2a.log > /tmp/dns/myip2.log

Changed lines 14-15 from:

grep -o -f myip2.log dns.log > myipck.log

to:

grep -o -f myip2.log dns.log > /tmp/dns/myipck.log

Deleted line 16:
Changed line 19 from:
    if [ $? -eq 0 ]        # Test exit status of "cmp" command.
to:

if [ $? -eq 0 ] # Test exit status of "cmp" command.

Changed lines 21-23 from:
    echo "File \"myip2.log\" is identical to file \"myipck.log\"." >> dnsOK.log

else

    zoneedit.script >> zoneedit.log
to:
  echo "File \"myip2.log\" is identical to file \"myipck.log\"." >> /tmp/dns/okDNS.log

else /tmp/dns/zoneed

Changed lines 26-27 from:

exit 0 @]

to:

exit 0

 @]
Changed lines 39-40 from:

Here is my script to update Zoneedit website DNS For My Home Domain

to:

Here is my script to update Zoneedit website DNS For My Home Domain
Put his in the folder that matches the dnsck.script

April 23, 2006, at 01:44 AM by 70.254.171.249 -
Changed line 1 from:

Automatically Updating Dynamic IP for Zoneedit DNS Server

to:

Automatically Updating Dynamic IP for Zoneedit DNS Server\\

April 23, 2006, at 01:44 AM by 70.254.171.249 -
Changed lines 2-3 from:
to:

Put this is in the Cron.Hourly making sure to update and path references

April 23, 2006, at 01:39 AM by zeppo -
Changed line 11 from:
  1. Strip out whitespace of results of myip result then remove extra line
to:
  1. Strip out whitespace of results of myip1.log result then remove extra line
April 23, 2006, at 01:38 AM by zeppo -
Deleted lines 2-4:

After looking at this website http://www.student.northpark.edu/pemente/sed/sed1line.txt... How about this?

Changed lines 97-103 from:

to:

Trouble with SED? After looking at this website http://www.student.northpark.edu/pemente/sed/sed1line.txt... How about this?

.

April 23, 2006, at 01:37 AM by zeppo -
Deleted line 0:
Changed lines 67-68 from:

Here are my earlier notes as I worked through this problem:

to:

Here are my earlier notes as I worked through this problem:

April 23, 2006, at 01:36 AM by zeppo -
Changed lines 1-35 from:

sed 's/^[ \t]*//' ip2.log > ip4.log

clears the leading white space from one file and puts just the text in another file.


  1. delete BOTH leading and trailing whitespace from each line

sed 's/^[ \t]*//;s/[ \t]*$//'

From http://www.unixguide.net/unix/sedoneliner.shtml


Maybe this will help
(3) < Redirector Symbol
Syntax:
Linux-command < filename
To take input to Linux-command from file instead of key-board. For e.g. To take input for cat command give
$ cat < myfiles
from http://www.freeos.com/guides/lsst/index.html


And maybe grep will help (I could have them in two lines in one file).

http://pegasus.rutgers.edu/~elflord/unix/grep.html

And to match exactly an IP number from one file to another, maybe this will help

grep -o -f ip1.log ip2.log


to:
Changed lines 66-101 from:

.

to:

Here are my earlier notes as I worked through this problem:

sed 's/^[ \t]*//' ip2.log > ip4.log

clears the leading white space from one file and puts just the text in another file.


  1. delete BOTH leading and trailing whitespace from each line

sed 's/^[ \t]*//;s/[ \t]*$//'

From http://www.unixguide.net/unix/sedoneliner.shtml


Maybe this will help
(3) < Redirector Symbol
Syntax:
Linux-command < filename
To take input to Linux-command from file instead of key-board. For e.g. To take input for cat command give
$ cat < myfiles
from http://www.freeos.com/guides/lsst/index.html


And maybe grep will help (I could have them in two lines in one file).

http://pegasus.rutgers.edu/~elflord/unix/grep.html

And to match exactly an IP number from one file to another, maybe this will help

grep -o -f ip1.log ip2.log


April 23, 2006, at 01:35 AM by zeppo -
Changed lines 80-81 from:

Here is my script to update Zoneedit website DNS For My Home Domain

to:

Here is my script to update Zoneedit website DNS For My Home Domain

April 23, 2006, at 01:34 AM by zeppo -
Changed lines 70-71 from:

See PHP section to get a page to return just your IP

to:

See PHP section to get a page to return just your IP, but here it is also
Display IP Address

On a remote server to display the IP of the the requesting computer I used this

<?php
$ip = getenv('REMOTE_ADDR');
PRINT("$ip");
?>

April 23, 2006, at 01:33 AM by zeppo -
Added lines 72-79:

Here is my script to update Zoneedit website DNS For My Home Domain

Create a shell script that has this: (A line for each domain name)
#!/bin/sh
lynx -source -auth=NAME:PASSWORD 'http://dynamic.zoneedit.com/auth/dynamic.html?host=www.virtual-weltanschauung.org'
lynx -source -auth=NAME:PASSWORD 'http://dynamic.zoneedit.com/auth/dynamic.html?host=harpo.virtual-weltanschauung.org'
lynx -source -auth=NAME:PASSWORD 'http://dynamic.zoneedit.com/auth/dynamic.html?host=virtual-weltanschauung.org' >> /tmp/zone.log 
April 23, 2006, at 01:30 AM by zeppo -
Added lines 36-37:

Automatically Updating Dynamic IP for Zoneedit DNS Server

Added lines 70-71:

See PHP section to get a page to return just your IP

April 23, 2006, at 01:28 AM by zeppo -
Deleted lines 69-71:

So I should be able to simply put in the update script instead of "differs from file" messages, shouldn't I?

Changed lines 78-80 from:

So I put it in the Cron.hourly folder. And we will see

to:

So I put it in the Cron.hourly folder. And we will see.

.

April 23, 2006, at 01:27 AM by zeppo -
Added line 41:
  1. You could probably use http://checkip.dyndns.org/ and then somehow strip out the text
Changed line 61 from:
    echo "File \"myip2.log\" is identical to file \"myipck.log\"."
to:
    echo "File \"myip2.log\" is identical to file \"myipck.log\"." >> dnsOK.log
Changed line 63 from:
    echo "File \"myip2.log\" differs from file \"myipck.log\"."
to:
    zoneedit.script >> zoneedit.log
Changed lines 75-81 from:

.

to:

I put this all together and powered down my DSL modem for 30 minutes, after which it jused another IP.

I rand the above shell script and bingo it worked.

So I put it in the Cron.hourly folder. And we will see

April 22, 2006, at 03:03 PM by zeppo -
Changed line 40 from:
  1. Determin my ip
to:
  1. Determine my ip
Changed line 43 from:
  1. Determin current DNS of domain name
to:
  1. Determine current DNS of domain name
April 22, 2006, at 03:02 PM by zeppo -
Changed lines 72-73 from:

I'm sure any try Unix or Linux aficionado would be horrified by this, but until somebody shows me wonderful world of geeky purity I'll keep pfutzing around like this.

to:

I'm sure any true Unix or Linux aficionado would be horrified by this, but until somebody shows me wonderful world of geeky purity I'll keep pfutzing around like this.

April 22, 2006, at 03:02 PM by zeppo -
Changed lines 72-74 from:

I'm sure any try Unix or Linux aficionado would be horrified by this, but until somebody shows me wonderful world of geeky purity I keep pfutzing around like this.

to:

I'm sure any try Unix or Linux aficionado would be horrified by this, but until somebody shows me wonderful world of geeky purity I'll keep pfutzing around like this.

.

April 22, 2006, at 03:01 PM by zeppo -
Added lines 70-72:

I'm sure any try Unix or Linux aficionado would be horrified by this, but until somebody shows me wonderful world of geeky purity I keep pfutzing around like this.

April 22, 2006, at 02:59 PM by zeppo -
Added lines 68-69:

So I should be able to simply put in the update script instead of "differs from file" messages, shouldn't I?

April 22, 2006, at 02:56 PM by zeppo -
Added line 42:
Added line 45:
Added line 49:
Added line 52:
Added line 55:
April 22, 2006, at 02:55 PM by zeppo -
Changed line 36 from:
to:

After looking at this website http://www.student.northpark.edu/pemente/sed/sed1line.txt...

April 22, 2006, at 02:53 PM by zeppo -
Changed line 44 from:
  1. Strip out whitespace of results of my ip result the remove extra line
to:
  1. Strip out whitespace of results of myip result then remove extra line
April 22, 2006, at 02:52 PM by zeppo -
Changed lines 60-62 from:

exit 0 @]

to:

exit 0 @]


April 22, 2006, at 02:52 PM by zeppo -
Changed lines 39-57 from:

[@#!/bin/sh
# Determin my ip
lynx -dump "http://www.virtual-weltanschauung.com/t3.php" > myip1.log
# Determin current DNS of domain name
ping -c 1 www.virtual-weltanschauung.org | fgrep PING > dns.log
# Strip out whitespace of results of my ip result the remove extra line
sed 's/^[ \t]*//;s/[ \t]*$//' myip1.log > myip2a.log
sed '/^$/d' myip2a.log > myip2.log
# Use grep to find refined my ip addr in DNS result
grep -o -f myip2.log dns.log > myipck.log
# compare the result of grep to the refined myIP
cmp myip2.log myipck.log > /dev/null # /dev/null buries the output of the "cmp" command.
# Also works with 'diff', i.e., diff $1 $2 > /dev/null

    if [ $? -eq 0 ]        # Test exit status of "cmp" command.
then
echo "File \"myip2.log\" is identical to file \"myipck.log\"."
else\\ echo "File \"myip2.log\" differs from file \"myipck.log\"."\\
to:

[@#!/bin/sh

  1. Determin my ip

lynx -dump "http://www.virtual-weltanschauung.com/t3.php" > myip1.log

  1. Determin current DNS of domain name

ping -c 1 www.virtual-weltanschauung.org | fgrep PING > dns.log

  1. Strip out whitespace of results of my ip result the remove extra line

sed 's/^[ \t]*//;s/[ \t]*$//' myip1.log > myip2a.log sed '/^$/d' myip2a.log > myip2.log

  1. Use grep to find refined my ip addr in DNS result

grep -o -f myip2.log dns.log > myipck.log

  1. compare the result of grep to the refined myIP

cmp myip2.log myipck.log > /dev/null # /dev/null buries the output of the "cmp" command.

  1. Also works with 'diff', i.e., diff $1 $2 > /dev/null

    if [ $? -eq 0 ]        # Test exit status of "cmp" command.

then

    echo "File \"myip2.log\" is identical to file \"myipck.log\"."

else

    echo "File \"myip2.log\" differs from file \"myipck.log\"."
April 22, 2006, at 02:50 PM by zeppo -
Changed line 39 from:
#!/bin/sh\\
to:

[@#!/bin/sh\\

Changed line 53 from:
if [ $? -eq 0 ] # Test exit status of "cmp" command.\\
to:
    if [ $? -eq 0 ]        # Test exit status of "cmp" command.\\
Changed line 55 from:
echo "File \"myip2.log\" is identical to file \"myipck.log\"."\\
to:
    echo "File \"myip2.log\" is identical to file \"myipck.log\"."\\
Changed line 57 from:
echo "File \"myip2.log\" differs from file \"myipck.log\"."\\
to:
    echo "File \"myip2.log\" differs from file \"myipck.log\"."\\
Changed line 60 from:

exit 0

to:

exit 0 @]

April 22, 2006, at 02:49 PM by zeppo -
Changed line 53 from:

if [ $? -eq 0 ] # Test exit status of "cmp" command.\\

to:
if [ $? -eq 0 ] # Test exit status of "cmp" command.\\
Changed line 55 from:
echo "File \"myip2.log\" is identical to file \"myipck.log\"."\\
to:
echo "File \"myip2.log\" is identical to file \"myipck.log\"."\\
Changed line 57 from:
echo "File \"myip2.log\" differs from file \"myipck.log\"."\\
to:
echo "File \"myip2.log\" differs from file \"myipck.log\"."\\
April 22, 2006, at 02:49 PM by zeppo -
Changed line 39 from:
  1. !/bin/sh\\
to:
#!/bin/sh\\
April 22, 2006, at 02:48 PM by zeppo -
Added lines 34-60:

How about this?

  1. !/bin/sh
    # Determin my ip
    lynx -dump "http://www.virtual-weltanschauung.com/t3.php" > myip1.log
    # Determin current DNS of domain name
    ping -c 1 www.virtual-weltanschauung.org | fgrep PING > dns.log
    # Strip out whitespace of results of my ip result the remove extra line
    sed 's/^[ \t]*//;s/[ \t]*$//' myip1.log > myip2a.log
    sed '/^$/d' myip2a.log > myip2.log
    # Use grep to find refined my ip addr in DNS result
    grep -o -f myip2.log dns.log > myipck.log
    # compare the result of grep to the refined myIP
    cmp myip2.log myipck.log > /dev/null # /dev/null buries the output of the "cmp" command.
    # Also works with 'diff', i.e., diff $1 $2 > /dev/null

if [ $? -eq 0 ] # Test exit status of "cmp" command.
then
-> echo "File \"myip2.log\" is identical to file \"myipck.log\"."
else\\

echo "File \"myip2.log\" differs from file \"myipck.log\"."
fi

exit 0

April 22, 2006, at 01:55 PM by zeppo -
Changed lines 23-24 from:

to:

Changed lines 27-33 from:

http://pegasus.rutgers.edu/~elflord/unix/grep.html

to:

http://pegasus.rutgers.edu/~elflord/unix/grep.html

And to match exactly an IP number from one file to another, maybe this will help

grep -o -f ip1.log ip2.log

April 22, 2006, at 01:54 PM by zeppo -
Changed lines 8-27 from:

From http://www.unixguide.net/unix/sedoneliner.shtml

to:

From http://www.unixguide.net/unix/sedoneliner.shtml


Maybe this will help
(3) < Redirector Symbol
Syntax:
Linux-command < filename
To take input to Linux-command from file instead of key-board. For e.g. To take input for cat command give
$ cat < myfiles
from http://www.freeos.com/guides/lsst/index.html


And maybe grep will help (I could have them in two lines in one file).

http://pegasus.rutgers.edu/~elflord/unix/grep.html

April 22, 2006, at 04:48 AM by zeppo -
Changed lines 4-7 from:
to:

  1. delete BOTH leading and trailing whitespace from each line

sed 's/^[ \t]*//;s/[ \t]*$//'

April 22, 2006, at 04:47 AM by zeppo -
Changed lines 3-5 from:

clears the leading white space from one file and puts just the text in another file.

to:

clears the leading white space from one file and puts just the text in another file.

From http://www.unixguide.net/unix/sedoneliner.shtml

April 22, 2006, at 04:47 AM by zeppo -
Added lines 1-3:

sed 's/^[ \t]*//' ip2.log > ip4.log

clears the leading white space from one file and puts just the text in another file.

Edit - History - Print - Recent Changes - Search
Page last modified on April 24, 2006, at 05:07 AM