Skip to content

Instantly share code, notes, and snippets.

@xgdgsc
Created June 28, 2017 15:11
Show Gist options
  • Save xgdgsc/9fb2b21f48d652c16ca826f717bb3c98 to your computer and use it in GitHub Desktop.
Save xgdgsc/9fb2b21f48d652c16ca826f717bb3c98 to your computer and use it in GitHub Desktop.
tail-slack
#!/bin/bash
tail -n0 -F "$1" | while read LINE; do
(echo "$LINE" | grep -e "$3") && curl -X POST --silent --data-urlencode \
"payload={\"text\": \"$(echo $LINE | sed "s/\"/'/g")\"}" "$2";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment