Created
March 10, 2017 21:49
-
-
Save greenbicycle/bcb764f1ff3b89ab0da53fef29201bed to your computer and use it in GitHub Desktop.
Send a slack alert
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 | |
| # | |
| # Send a slack alert to a channel | |
| # | |
| # Find the SLACK_URL for the desired channel | |
| # | |
| # | |
| # echo "Sending message to slack channel" | |
| SLACK_URL=<your slack url> | |
| MESSAGE=$@ | |
| DATA="{\"text\":\"$MESSAGE\", \"icon_emoji\":\"ghost\"}" | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data "$DATA" \ | |
| $SLACK_URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment