From 06456cfb92877ee7547e497b5a96fef4532fe58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20M=C3=A4ndlen?= Date: Tue, 3 Mar 2015 15:09:17 +0100 Subject: [PATCH] added myip-plugin --- plugins/myip/README.md | 15 +++++++++++++++ plugins/myip/myip.plugin.zsh | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 plugins/myip/README.md create mode 100644 plugins/myip/myip.plugin.zsh diff --git a/plugins/myip/README.md b/plugins/myip/README.md new file mode 100644 index 000000000..952f94faa --- /dev/null +++ b/plugins/myip/README.md @@ -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. diff --git a/plugins/myip/myip.plugin.zsh b/plugins/myip/myip.plugin.zsh new file mode 100644 index 000000000..04ed8d803 --- /dev/null +++ b/plugins/myip/myip.plugin.zsh @@ -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} +}