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 | |
#script for checking availability of amd's rx 6900 xt graphics card | |
page='https://www.amd.com/en/direct-buy/5458372200/us' | |
agent='User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0' | |
result=$(curl -H "${agent}" -H 'Cache-Control: no-cache' -s "${page}") | |
pattern='out of stock' | |
if ! grep -qie "${pattern}" <<< $result; then | |
XDG_RUNTIME_DIR=/run/user/$(id -u) notify-send \ |