Skip to content

Instantly share code, notes, and snippets.

@deven96
Created March 19, 2021 12:54
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 deven96/7cbeff085ab9f1f4717c816fd1b9ca98 to your computer and use it in GitHub Desktop.
Save deven96/7cbeff085ab9f1f4717c816fd1b9ca98 to your computer and use it in GitHub Desktop.
Slack related utilities
#!/bin/bash
# check if slack.sh exists else download it
# using curl
function checkSlackUtilityExists {
if [ -f "./slack.sh" ]; then
chmod +x ./slack.sh
else
echo -e "Downloading slack utility..." &&
curl -o ./slack.sh https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw/c8a47aec0f08ca6dc64201ba40f09ff8c79f735e/slack.sh -s && chmod +x ./slack.sh &&
echo -e "Complete!"
fi
}
# send message to slack using slack.sh
# e.g sendMessageToSlackChannel "I am away because my leg suddenly dissipated"
function sendMessageToSlackChannel {
echo -e "Sending to Slack channel"
./slack.sh "$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment