Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Created July 6, 2018 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtrouton/bf2d613d41a7b8a7116fb50c939df5ab to your computer and use it in GitHub Desktop.
Save rtrouton/bf2d613d41a7b8a7116fb50c939df5ab to your computer and use it in GitHub Desktop.
#!/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