From 26e6bd40bb5e203c8d24416399c18be598a54f4d Mon Sep 17 00:00:00 2001 From: thek4n Date: Thu, 9 Jan 2025 00:24:09 +0300 Subject: [PATCH] myip command --- home/user/.local/bin/myip | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/home/user/.local/bin/myip b/home/user/.local/bin/myip index 35b4fb1..69e7323 100755 --- a/home/user/.local/bin/myip +++ b/home/user/.local/bin/myip @@ -1,6 +1,12 @@ #!/bin/sh -curl ipinfo.io/ip -echo -dig +short myip.opendns.com @resolver1.opendns.com \ No newline at end of file +TAB="$(printf -- '\t')" + +{ + printf "%s\t" "curl ipinfo.io/ip" + curl ipinfo.io/ip 2>/dev/null + echo + printf "%s\t" "dig +short myip.opendns.com @resolver1.opendns.com" + dig +short myip.opendns.com @resolver1.opendns.com 2>/dev/null +} | column -t -s "${TAB}"