Created
April 10, 2022 12:57
-
-
Save Oldes/c119655b59b30cf431d51f589961ded1 to your computer and use it in GitHub Desktop.
Resolve external IP address
This file contains 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
Rebol [] | |
my-ip?: function[ | |
"Resolves external IP address" | |
][ | |
quiet: system/options/quiet | |
system/options/quiet: true | |
host-name: read dns:// | |
local-ip: read join dns:// host-name | |
external-ip: read http://ifconfig.me/ip | |
system/options/quiet: quiet | |
sys/log/info 'REBOL ["Host-name: ^[[m" host-name] | |
sys/log/info 'REBOL ["Local-ip: ^[[m" local-ip] | |
sys/log/info 'REBOL ["External-ip:^[[m" external-ip] | |
external-ip | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment