refactor: update pureos to use web_pipe()

This commit is contained in:
Martin Wimpress 2024-04-19 22:15:54 +01:00 committed by Martin Wimpress
parent 2e9b650711
commit b69c62e051
1 changed files with 3 additions and 3 deletions

View File

@ -2663,16 +2663,16 @@ function get_pureos() {
local ISO="" local ISO=""
local URL="" local URL=""
local PureName= local PureName=
PureName="$(wget -q -O- "https://www.pureos.net/download/" | grep -m 1 "downloads.puri" | cut -d '/' -f 4)" PureName="$(web_pipe "https://www.pureos.net/download/" | grep -m 1 "downloads.puri" | cut -d '/' -f 4)"
local PureDate= local PureDate=
PureDate="$(wget -q -O- "https://www.pureos.net/download/" | grep -m 1 "downloads.puri" | cut -d '/' -f 6)" PureDate="$(web_pipe "https://www.pureos.net/download/" | grep -m 1 "downloads.puri" | cut -d '/' -f 6)"
local PureDateSquashed="${PureDate//'-'/}" local PureDateSquashed="${PureDate//'-'/}"
edition="${EDITION,,}" edition="${EDITION,,}"
URL="https://downloads.puri.sm/${PureName}/${edition}/${PureDate}" URL="https://downloads.puri.sm/${PureName}/${edition}/${PureDate}"
ISO="pureos-${RELEASE}-${edition}-live-${PureDateSquashed}_amd64.iso" ISO="pureos-${RELEASE}-${edition}-live-${PureDateSquashed}_amd64.iso"
local IsoTrimmed= local IsoTrimmed=
IsoTrimmed="${ISO%.*}" IsoTrimmed="${ISO%.*}"
HASH="$(wget -q -O- "${URL}/${IsoTrimmed}.checksums_sha256.txt" | grep -m 1 '.iso' | cut -d '.' -f 1)" HASH="$(web_pipe "${URL}/${IsoTrimmed}.checksums_sha256.txt" | grep -m 1 '.iso' | cut -d '.' -f 1)"
echo "${URL}/${ISO} ${HASH}" echo "${URL}/${ISO} ${HASH}"
} }