Jump to content

[fix] Reveal Public Ip


WatskeBart

Recommended Posts

EDIT: Just contributed the code on GitHub ;)

The reveal public IP option from the status page wasn't working on my pineapple with FW v1.1.1

Probably because of changes at http://whatismyip.org

I have a new piece of code for you all :)

Edit this file in your favorite texteditor: (i used notepad++)

/www/pineapple/index.php

Look for this line: (line 77 in my case)

echo exec("wget -qO- http://whatismyip.org") . "<br />";

And change it into this line:

echo exec("wget -qO- http://checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//' ") . "<br />"; 

If you want to test the code first, login your pineapple via SSH and copy/paste following code:

wget -qO- http://whatismyip.org

this will fail :P

but

wget -qO- http://checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

will work :lol:

Maybe Seb could take this fix in next firmware release ;)

Edited by WatskeBart
Link to comment
Share on other sites

The reveal public IP option from the status page wasn't working on my pineapple with FW v1.1.1

Probably because of changes at http://whatismyip.org

I have a new piece of code for you all :)

Edit this file in your favorite texteditor: (i used notepad++)

/www/pineapple/index.php

Look for this line: (line 77 in my case)

echo exec("wget -qO- http://whatismyip.org") . "<br />";

And change it into this line:

echo exec("wget -qO- http://checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//' ") . "<br />"; 

If you want to test the code first, login your pineapple via SSH and copy/paste following code:

wget -qO- http://whatismyip.org

this will fail :P

but

wget -qO- http://checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

will work :lol:

Maybe Seb could take this fix in next firmware release ;)

replacing http://whatismyip.org with http://icanhazip.com work perfectly too :)

Link to comment
Share on other sites

I second icanhazip.com!

wget -qO- icanhazip.com

I agree the code stays clean and crisp that way.

But i'm not to fond with small or privately owned websites, because you never know for how long they will be up or support the service.

I think that a website like dyndns, won't be leaving the interwebs soon :)

Stability is my goal ;)

Link to comment
Share on other sites

I agree the code stays clean and crisp that way.

But i'm not to fond with small or privately owned websites, because you never know for how long they will be up or support the service.

I think that a website like dyndns, won't be leaving the interwebs soon :)

Stability is my goal ;)

.dyndns.org websites are FREE domain names given by dyndns.com. I know this because I have a .dyndns.org site myself becuase I dont want to pay for a domain name yet.

Link to comment
Share on other sites

ipchicken has been around for years and years...I don't have my pineapple near me (traveling unfortunately without it.../cry) to test, but has anyone gotten that to work?

telot

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...