Created
November 18, 2020 17:37
-
-
Save andrelugomes/6ec4ddb3d3e8418dad6d47ebf3540b7e to your computer and use it in GitHub Desktop.
How to send my IP over Slack
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
#!/bin/sh | |
#MEU_IP=$(dig +short myip.opendns.com @resolver1.opendns.com); | |
#MEU_IP=$(curl ifconfig.co) | |
MEU_IP=$(curl 'https://api.ipify.org?format=human') | |
USER=$(whoami) | |
curl -X POST --data-urlencode \ | |
"payload={\"channel\": \"#channel\", \"username\": \"meu-ip\", \"text\": \"$USER : $MEU_IP\", \"icon_emoji\": \":aaaa:\"}" \ | |
https://hooks.slack.com/services/WEB_HOOK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment