How I can I get my home network's IP address from a shell script?

Posted by Steven Stewart-Gallus on Stack Overflow See other posts from Stack Overflow or by Steven Stewart-Gallus
Published on 2012-06-15T23:07:59Z Indexed on 2012/06/16 3:16 UTC
Read the original article Hit count: 237

Filed under:
|
|

I have an account at a server at school, and a home computer that I need to work with sometimes. I have exchanged keys, and now only have one problem. While my school account has a name associated with it, "account_name@school", my home network does not. My plan is to have a script that every hour retrieves my home network's IP address, ssh'es into my school account and updates my ssh config file storing my home network's IP address.

How can I retrieve my home computer's IP address from a shell script?

P.S. Is this a sensible plan?

© Stack Overflow or respective owner

Related posts about ssh

Related posts about ip