Last active
April 20, 2022 05:13
-
-
Save hardikmdev/d5b2a48de1f86fdfc3568178677979a2 to your computer and use it in GitHub Desktop.
get_public_ip_add.sh
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
# This example requires the requests library be installed. You can learn more | |
# about the Requests library here: http://docs.python-requests.org/en/latest/ | |
from requests import get | |
ip = get('https://api.ipify.org').text | |
print('My public IP address is: {}'.format(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
#!/bin/bash | |
ip=$(curl -s https://api.ipify.org) | |
echo "My public IP address is: $ip" | |
# ip=`curl -s https://api.ipify.org` | |
# echo("My public IP address is: $ip") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment