Skip to content

Instantly share code, notes, and snippets.

@greenbicycle
Created March 10, 2017 21:49
Show Gist options
  • Select an option

  • Save greenbicycle/bcb764f1ff3b89ab0da53fef29201bed to your computer and use it in GitHub Desktop.

Select an option

Save greenbicycle/bcb764f1ff3b89ab0da53fef29201bed to your computer and use it in GitHub Desktop.
Send a slack alert
#!/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