File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ # fetch_latest_iso.sh
2+ # Author: D.A.Pelasgus
3+ #! /bin/bash
4+
5+ # Variables for repository and output file with directory fallback
6+ REPO=" ${REPO:- chimeraos/ install-media} "
7+ OUTPUT_FILE=" ${OUTPUT_FILE:- latest_iso_download_url.txt} "
8+
9+ # Fetch the latest release data from the GitHub API
10+ response=$( curl -s " https://api.github.com/repos/$REPO /releases/latest" )
11+
12+ # Check if the response contains assets and find an ISO asset
13+ iso_url=$( echo " $response " | jq -r ' .assets[] | select(.name | endswith(".iso")) | .browser_download_url' )
14+ iso_name=$( echo " $response " | jq -r ' .assets[] | select(.name | endswith(".iso")) | .name' )
15+
16+ # Verify if an ISO file was found
17+ if [[ -n " $iso_url " ]]; then
18+ echo " ISO file found: $iso_name "
19+ echo " Download URL: $iso_url "
20+
21+ # Save the download link to the output file
22+ echo " $iso_url " > " $OUTPUT_FILE "
23+ else
24+ echo " Error: ISO file not found in the latest release."
25+ exit 1
26+ fi
You can’t perform that action at this time.
0 commit comments