Created
August 15, 2016 08:02
-
-
Save shengyou/43f4cc77884640238492fb33cd3083a3 to your computer and use it in GitHub Desktop.
在 bash 裡取得機器的對外實體 IP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ip="$(dig +short myip.opendns.com @resolver1.opendns.com)" | |
echo "My WAN/Public IP address: ${ip}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
參考這篇文章裡的說明: