Adds a timer that checks for restock of pinecil
This commit is contained in:
parent
8ba39ecc04
commit
55e256ad59
3 changed files with 26 additions and 0 deletions
9
systemd/.config/systemd/user/checkStock
Executable file
9
systemd/.config/systemd/user/checkStock
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
url="https://pine64.com/product/pinecil-smart-mini-portable-soldering-iron/"
|
||||
string="out of stock"
|
||||
|
||||
curl -sL "$url" | hq h1 text | grep -vqi "$string"
|
||||
if [ "$?" -eq 0 ]; then
|
||||
notify-send "Pinecil back in stock"
|
||||
fi
|
8
systemd/.config/systemd/user/stock.service
Normal file
8
systemd/.config/systemd/user/stock.service
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Unit]
|
||||
Description=Check stock
|
||||
|
||||
[Service]
|
||||
ExecStart=/home/jonathan/.config/systemd/user/checkStock
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
9
systemd/.config/systemd/user/stock.timer
Normal file
9
systemd/.config/systemd/user/stock.timer
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Check stock every hour
|
||||
|
||||
[Timer]
|
||||
OnBootSec=1h
|
||||
OnUnitActiveSec=1h
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Loading…
Add table
Add a link
Reference in a new issue