$ cat fw_check.sh
#!/bin/bash
TAG_STORAGE_LOCATION="$HOME/.config/coreboot-notifier"
TAG_FILE="$TAG_STORAGE_LOCATION/last_tag"
TAGS_URL="https://source.puri.sm/api/v4/projects/287/repository/tags"
# Make sure these exist even on first run
mkdir -p "$TAG_STORAGE_LOCATION"
touch "$TAG_FILE"
# Check last coreboot tag
last_tag=$(curl -s "$TAGS_URL" | jq -r '.[0].name')
# Check last known tag
last_known_tag=$(cat "$TAG_FILE")
if [ "$last_known_tag" != "$last_tag" ]
then
# Probably we need a bit louder notification here...
echo "New coreboot release detected - $last_tag! Go get it now!"
echo "$last_tag" > "$TAG_FILE"
else
echo "No new releases found."
fi
Result:
$ ./fw_check.sh
New coreboot release detected - 4.12-Purism-6! Go get it now!
$ ./fw_check.sh
No new releases found.
You could add it to cron (e.g. schedule it for daily execution) and replace echo with some kind of a sensible notification.