A simple script to check your BIOS version against Gigabyte's website. Requires html-query and jq
Created
March 27, 2025 08:40
-
-
Save zikeji/32c5e0c9a705e7e71a76001b7d5fadf1 to your computer and use it in GitHub Desktop.
A simple script to check your BIOS version against Gigabyte's website. Requires html-query and jq
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 | |
# Define color codes | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[0;33m' | |
BLUE='\033[0;34m' | |
CYAN='\033[0;36m' | |
RESET='\033[0m' | |
URL="https://www.gigabyte.com/Motherboard/B850M-GAMING-X-WIFI6E/support" | |
JSON=$(curl -s "$URL" | hq '{bios: .div-table-body-BIOS | [ { v: .download-version, date: .download-date, site: .download-site > div > a | @(href)} ] }') | |
CURRENT_BIOS=$(sudo dmidecode -s bios-version) | |
LATEST_BIOS=$(echo "$JSON" | jq -r '.bios[0].v') | |
DOWNLOAD_LINK=$(echo "$JSON" | jq -r '.bios[0].site') | |
RELEASE_DATE=$(echo "$JSON" | jq -r '.bios[0].date') | |
if [[ "$CURRENT_BIOS" != "$LATEST_BIOS" ]]; then | |
echo -e "${YELLOW}BIOS Update Available!${RESET}" | |
echo -e "${CYAN}Current Version:${RESET} ${RED}$CURRENT_BIOS${RESET}" | |
echo -e "${CYAN}Latest Version:${RESET} ${GREEN}$LATEST_BIOS${RESET} ${CYAN}(Released: $RELEASE_DATE)${RESET}" | |
echo -e "${CYAN}Download Link:${RESET} ${BLUE}\e]8;;$DOWNLOAD_LINK\a$DOWNLOAD_LINK\e]8;;\a${RESET}" | |
else | |
echo -e "${GREEN}BIOS is up to date (Version: $CURRENT_BIOS)${RESET}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment