diff options
author | lshprung <lshprung@yahoo.com> | 2021-08-18 15:03:13 -0700 |
---|---|---|
committer | lshprung <lshprung@yahoo.com> | 2021-08-18 15:03:13 -0700 |
commit | 57723d148795bffcbc96b500975af17dd14bafbf (patch) | |
tree | b5e7322ad28ce23dab70f3e50d3e07b44c908d93 /update_ungoogled_chromium-portable_linux_64.sh | |
parent | 3558fdedc10ed2317cc497725a35e7c0562175e0 (diff) |
Ready to extract tar file
Diffstat (limited to 'update_ungoogled_chromium-portable_linux_64.sh')
-rwxr-xr-x | update_ungoogled_chromium-portable_linux_64.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/update_ungoogled_chromium-portable_linux_64.sh b/update_ungoogled_chromium-portable_linux_64.sh index 0e7ddff..3ad6f46 100755 --- a/update_ungoogled_chromium-portable_linux_64.sh +++ b/update_ungoogled_chromium-portable_linux_64.sh @@ -128,3 +128,22 @@ else exit 2 fi fi + +# Download tar file to /tmp +DOWNLOAD_URL=$(curl -s "$URL" | grep -E -o "href=\".*tar\.xz\"" | cut -d '"' -f 2) +# wget --quiet -O "/tmp/ungoogled-chromium_${VERSION}_linux.tar.xz" "$DOWNLOAD_URL" +TAR_FILE="/tmp/ungoogled-chromium_${VERSION}_linux.tar.xz" +if [ ! -r "$TAR_FILE" ]; then + echo "Error: Issue downloading ungoogled-chromium $VERSION from $DOWNLOAD_URL" + exit 0 +fi + +# Check hash +HASH=$(curl -s "$URL" | grep "MD5" | sed 's/<[^<>]*>//g;s/[ ]//g' | cut -d ':' -f 2) +if [ "$HASH" != $(md5sum "$TAR_FILE" | cut -d ' ' -f 1) ]; then + echo "Error: MD5 checksum failed" + rm "$TAR_FILE" + exit 0 +fi + +# Extract to INSTALL_TO |