Created
January 27, 2016 02:42
-
-
Save scalopus/b3e81fb7062d4794c7ff to your computer and use it in GitHub Desktop.
Current IP Address from `ifconfig` to Slack Channel Integration
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 | |
# Tested on Ubuntu 14.04 LTS | |
ifconfig |grep '192.168.9'|cut -d: -f2 |awk '{print "{\"text\":\""$1"\"}"}' |curl -X POST -H 'Content-type: application/json' --data @- https://hooks.slack.com/services/<SLACKTOKEN> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment