Last active
January 31, 2018 14:56
-
-
Save AndySun25/9953e4aeb5a75cb6cdf0719419cd56fc to your computer and use it in GitHub Desktop.
Public version
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
#!/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