Created
August 28, 2019 05:41
-
-
Save salhernandez/d5170dbc829459c86fd5cc6076b46b9e to your computer and use it in GitHub Desktop.
Shell wrapper that sends push notification via Pushover when a task is completed.
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 | |
# Invoke it by .... sh notifyMe generateJs | |
# This is meant for tasks that require more than a few seconds to execute. Upon completion the push notification via Pushover will be sent. | |
# Can be used for compiling an Android .apk from React-Native, etc... | |
listDirectory="listDirectory" | |
buildAndroid="buildAndroid" | |
if [ $1 = $command1 ]; then | |
ls | |
elif [ $1 = buildAndroid ]; then | |
react-native build-android --release | |
else | |
echo "$1 is not a valid argument" | |
exit 1 | |
fi | |
# send pushover notification when done | |
curl -s \ | |
--form-string "token=<token>" \ | |
--form-string "user=<user>" \ | |
--form-string "title=<title>" \ | |
--form-string "message=Done with $1" \ | |
https://api.pushover.net/1/messages.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment