Skip to content

Instantly share code, notes, and snippets.

@shengyou
Created August 15, 2016 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shengyou/43f4cc77884640238492fb33cd3083a3 to your computer and use it in GitHub Desktop.
Save shengyou/43f4cc77884640238492fb33cd3083a3 to your computer and use it in GitHub Desktop.
在 bash 裡取得機器的對外實體 IP
#!/usr/bin/env bash
ip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
echo "My WAN/Public IP address: ${ip}"
@shengyou
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment