Created
October 18, 2016 07:16
-
-
Save didmar/2df29350949f37d6d3b165c5747f1812 to your computer and use it in GitHub Desktop.
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 | |
# Runs the given command and notifies you through Slack when its done ! | |
# You must first create a slack hook and set your username | |
URL="https://hooks.slack.com/services/T000000000/B0000000/xxxxxxxxxxxxxxx" | |
USERNAME="@your_user_name_here" | |
COMMAND=$* | |
$COMMAND | |
RET=$? | |
curl -X POST --data-urlencode "payload={\"channel\": \"${USERNAME}\", \"username\": \"wakemeup\", \"text\": \"(${RET}) Command terminated: ${COMMAND}\", \"icon_emoji\": \":ghost:\"}" $URL > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment