refactor: update ubuntu to use web_pipe()

This commit is contained in:
Martin Wimpress 2024-04-19 22:48:02 +01:00 committed by Martin Wimpress
parent 7984fe2e5e
commit 234cf563d5
1 changed files with 2 additions and 2 deletions

View File

@ -2916,11 +2916,11 @@ function get_ubuntu() {
URL="https://cdimage.ubuntu.com/${OS}/releases/${RELEASE}/release" URL="https://cdimage.ubuntu.com/${OS}/releases/${RELEASE}/release"
fi fi
if wget -q --spider "${URL}/SHA256SUMS"; then if wget -q --spider "${URL}/SHA256SUMS"; then
DATA=$(wget -qO- "${URL}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac") DATA=$(web_pipe "${URL}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac")
ISO=$(cut -d'*' -f2 <<<${DATA} | sed '1q;d') ISO=$(cut -d'*' -f2 <<<${DATA} | sed '1q;d')
HASH=$(cut -d' ' -f1 <<<${DATA} | sed '1q;d') HASH=$(cut -d' ' -f1 <<<${DATA} | sed '1q;d')
else else
DATA=$(wget -qO- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac") DATA=$(web_pipe "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac")
ISO=$(cut -d'*' -f2 <<<${DATA}) ISO=$(cut -d'*' -f2 <<<${DATA})
HASH=$(cut -d' ' -f1 <<<${DATA}) HASH=$(cut -d' ' -f1 <<<${DATA})
fi fi