Created
July 4, 2018 08:35
-
-
Save mtantawy/649d03e80a2b42dabb18359896317109 to your computer and use it in GitHub Desktop.
Steam Link pinger
This file contains hidden or 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 | |
| while true | |
| do | |
| LINES_COUNT=$(curl -s https://store.steampowered.com/app/353380/Steam_Link/ | grep -i 'Out of Stock' | wc -l) | |
| if [[ $LINES_COUNT -eq 0 ]]; then | |
| echo "NOT Out of Stock @ `date`" | |
| notify-send -i input-gaming -u critical "Steam Link" "It seems that Steam Link is NOT Out of Stock!" | |
| fi | |
| LINES_COUNT=$(curl -s https://store.steampowered.com/app/353380/Steam_Link/ | grep -i 'Add to Cart' | wc -l) | |
| if [[ $LINES_COUNT -gt 0 ]]; then | |
| echo "CAN be Added to Cart @ `date`" | |
| notify-send -i input-gaming -u critical "Steam Link" "It seems that Steam Link CAN be Added to Cart!" | |
| fi | |
| SLEEP_MINS=$((1 + $RANDOM % 10)) | |
| echo "Will retry in: $SLEEP_MINS mins" | |
| sleep $(($SLEEP_MINS * 60)) | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment