Skip to content

Commit

Permalink
Merge pull request matryer#1461 from codincafe/patch-1
Browse files Browse the repository at this point in the history
My External IP
  • Loading branch information
matryer authored Dec 11, 2020
2 parents de4baec + 1556c5b commit 7619828
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Network/external-ip-1.0.1h.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# <bitbar.title>My External IP</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>CodinCafe</bitbar.author>
# <bitbar.author.github>codincafe</bitbar.author.github>
# <bitbar.desc>This plugin will show your current external / public IP and allow you to copy the same to clipboard</bitbar.desc>
# <bitbar.image>https://i.imgur.com/Ar1JABA.png</bitbar.image>
# <bitbar.dependencies>curl</bitbar.dependencies>

echo "🌎"
echo '---'

if [ $(curl -LI http://google.com -o /dev/null -w '%{http_code}\n' -s) == "200" ]; then
OUTPUT=$(curl -s https://ipinfo.io/ip)
result_string="$OUTPUT | bash='/bin/bash' param1='-c' param2='/bin/echo $OUTPUT | pbcopy' terminal=false";
else
result_string="No Internet Connection"
fi

echo "$result_string"
echo ---
echo "Refresh... | refresh=true"

0 comments on commit 7619828

Please sign in to comment.