Skip to content

Instantly share code, notes, and snippets.

@AndySun25
Last active January 31, 2018 14:56
Show Gist options
  • Save AndySun25/9953e4aeb5a75cb6cdf0719419cd56fc to your computer and use it in GitHub Desktop.
Save AndySun25/9953e4aeb5a75cb6cdf0719419cd56fc to your computer and use it in GitHub Desktop.
Public version
#!/usr/bin/env bash
CONFIG_FILE=~/.iblame
if [ ! -e "$CONFIG_FILE" ] ; then
echo "Enter your name:"
read BLAMER
echo "BLAMER=${BLAMER}" >> ${CONFIG_FILE}
echo "Enter your webhook url:"
read BLAMES_TO
echo "BLAMES_TO=${BLAMES_TO}" >> ${CONFIG_FILE}
else
source "$CONFIG_FILE"
fi
PAYLOAD="{\"text\":\"$BLAMER blames $*\"}"
COMMAND="curl -X POST -H 'Content-type:application/json' --data '${PAYLOAD}' ${BLAMES_TO}"
eval ${COMMAND}
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment