mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-05 05:03:16 +02:00
added myip-plugin
This commit is contained in:
parent
e55c715508
commit
06456cfb92
2 changed files with 23 additions and 0 deletions
15
plugins/myip/README.md
Normal file
15
plugins/myip/README.md
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Goal
|
||||||
|
This adds a simple command to find out your current public IPv4 address
|
||||||
|
|
||||||
|
# Requirements
|
||||||
|
* connection to the internet using a IPv4 address
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
Type "myip" and get a line with your public IPv4 address back. Useful for
|
||||||
|
bugfixing, ssh-ing to your parents computer and more ;-)
|
||||||
|
|
||||||
|
This uses dig and opendns.com and is really nothing more than a convenient
|
||||||
|
wrapper for not very complex command.
|
||||||
|
|
||||||
|
# Improvements
|
||||||
|
Ideas for improvements? Fork this or contact me.
|
||||||
8
plugins/myip/myip.plugin.zsh
Normal file
8
plugins/myip/myip.plugin.zsh
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
# provide a command to find out your current external ip
|
||||||
|
# using opendns resolver
|
||||||
|
|
||||||
|
function myip() {
|
||||||
|
resolver="@resolver1.opendns.com"
|
||||||
|
ip="myip.opendns.com"
|
||||||
|
dig +short ${ip} ${resolver}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue