#1 2013-10-07 02:52:15

CSa
Trusted Member
Registered: 2013-10-06
Posts: 131

"What's my IP?" Script

[ depreciated - IP's now in email with subject (READ IN FULL) ]

Hey everyone,
just thought I'd share a little script that I use to easily grab my IP addresses and available IPv4 ports smile

I'm going to make a LowEndSpirit configurations script soon, so stay tuned!

# LowEndSpirit "What's my IP?"
# 07/10/13
# By CSa

ipv6addr=$(ip addr show dev venet0 | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d')
ipv4intr=$(ifconfig venet0:0 | grep 'inet addr' | cut -d ':' -f 2 | cut -d ' ' -f 1)
nodeaddr=$(wget -qO- ipecho.net/plain)
ports=${ipv4intr#*.*.*.}

echo Your external IPv6 address is:
echo $ipv6addr
echo
echo Your internal IPv4 address is:
echo $ipv4intr
echo
echo Your external IPv4 address is:
echo $nodeaddr
echo
echo Your LowEndSprit is reachable on these ports:
echo [$nodeaddr]:$ports\01 - $ports\20

This will give you an output like the following (without the redacted addresses):

Your external IPv6 address is:
2a02:$redacted$

Your internal IPv4 address is:
192.168.$redacted$

Your external IPv4 address is:
$redacted$.235

Your LowEndSprit is reachable on these ports:
[$redacted$.235]:1$redacted$ - 1$redacted$

Last edited by CSa (2013-10-07 10:38:38)


What's this? Torn: Soon to become the best blogging platform ever created!

Offline

#2 2013-10-07 08:06:45

Backtogeek
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,547
Website

Re: "What's my IP?" Script

Thanks pinned as a sticky.

If you want a free LES box in return just place the order and don't pay the invoice.

Ant.


http://LittleHappyCloud.net KVM VPS with 1TB Bandwidth for €3.00

Offline

#3 2013-10-07 08:29:11

Biboran
Trusted Member
From: Ukraine
Registered: 2013-10-05
Posts: 14

Re: "What's my IP?" Script

http://ifconfig.me/ip is too slow.
Change it to ipecho.net/plain

Offline

#4 2013-10-07 10:42:44

CSa
Trusted Member
Registered: 2013-10-06
Posts: 131

Re: "What's my IP?" Script

Backtogeek wrote:

Thanks pinned as a sticky.

If you want a free LES box in return just place the order and don't pay the invoice.

Ant.

Awesome! You realize you just fed my inner LEB addict xD
Now.. Location... Location.. Location.

Edit: I choose you, Italy! Invoice made, not paid smile

Biboran wrote:

http://ifconfig.me/ip is too slow.
Change it to ipecho.net/plain

Thanks! Edited.

Last edited by CSa (2013-10-07 11:35:28)


What's this? Torn: Soon to become the best blogging platform ever created!

Offline

#5 2013-10-07 12:24:58

Backtogeek
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,547
Website

Re: "What's my IP?" Script

Put through.


http://LittleHappyCloud.net KVM VPS with 1TB Bandwidth for €3.00

Offline

#6 2013-10-08 07:56:46

Biboran
Trusted Member
From: Ukraine
Registered: 2013-10-05
Posts: 14

Re: "What's my IP?" Script

Backtogeek, you can put this as default ssh welcome message in OS image.

Offline

#7 2013-10-09 00:23:20

CSa
Trusted Member
Registered: 2013-10-06
Posts: 131

Re: "What's my IP?" Script

Biboran wrote:

Backtogeek, you can put this as default ssh welcome message in OS image.

Recommended! smile Would help with those less advanced at linux.


What's this? Torn: Soon to become the best blogging platform ever created!

Offline

#8 2013-10-09 09:08:14

Backtogeek
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,547
Website

Re: "What's my IP?" Script

hmm...

I will consider it smile

I don't like the idea of people only knowing which buttons to press though, I like them to know what those buttons actually do.

I might put together a /scripts collection that goes in the root of the templates for LES specific stuff, but that will be on the next template refresh.


http://LittleHappyCloud.net KVM VPS with 1TB Bandwidth for €3.00

Offline

#9 2013-10-09 09:35:45

Backtogeek
Low End Boss
From: ~/
Registered: 2013-02-13
Posts: 3,547
Website

Re: "What's my IP?" Script

yeah, the last script I actually took any time over was: http://pastie.org/private/rrhexp7uqh8907oxpb3wtq almost a year ago.

I would probably just make 1 menu driven and user input driven shell script for getting information, running LES specific tasks etc etc.


http://LittleHappyCloud.net KVM VPS with 1TB Bandwidth for €3.00

Offline

#10 2013-10-09 10:56:27

CSa
Trusted Member
Registered: 2013-10-06
Posts: 131

Re: "What's my IP?" Script

Backtogeek wrote:

yeah, the last script I actually took any time over was: http://pastie.org/private/rrhexp7uqh8907oxpb3wtq almost a year ago.

I would probably just make 1 menu driven and user input driven shell script for getting information, running LES specific tasks etc etc.

I can do that. Something similar to raspi-config I think smile


What's this? Torn: Soon to become the best blogging platform ever created!

Offline

#11 2013-10-09 22:11:35

CSa
Trusted Member
Registered: 2013-10-06
Posts: 131

Re: "What's my IP?" Script

Ray wrote:

Guess CSa needs to start brushing up his l33t ncurses skillzzz  wink

Hahahaha yeah xD
Although the environment I work on really requires automated scripts like this to work!


What's this? Torn: Soon to become the best blogging platform ever created!

Offline

#12 2013-10-14 18:31:34

sc754
Member
Registered: 2013-09-29
Posts: 6

Re: "What's my IP?" Script

Uhm when I execute I don't get the right ip for ipv4. Mine is showing as +1 to the actual IP I ssh into, just fyi.

Offline

#13 2014-02-18 00:15:04

lacinonac
Trusted Member
Registered: 2014-02-10
Posts: 11

Re: "What's my IP?" Script

CSa I would like to use your script if you allow to make one to manage/change ssh port.

Cumps

Offline

Board footer