Created
March 19, 2021 12:54
-
-
Save deven96/7cbeff085ab9f1f4717c816fd1b9ca98 to your computer and use it in GitHub Desktop.
Slack related utilities
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
#!/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