This reverts commit bb2736c64e
.
This commit is contained in:
Родитель
bb2736c64e
Коммит
60f5f3a42d
43
lib.sh
43
lib.sh
|
@ -1264,32 +1264,27 @@ else
|
|||
msg_box "There seems to be an issue with your network, please try again later.\nThis script will now exit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -f /tmp/prerelease.version ]
|
||||
# Checksum of the downloaded file
|
||||
print_text_in_color "$ICyan" "Checking SHA256 checksum..."
|
||||
mkdir -p "$SHA256_DIR"
|
||||
curl_to_dir "$NCREPO" "$STABLEVERSION.tar.bz2.sha256" "$SHA256_DIR"
|
||||
SHA256SUM="$(tail "$SHA256_DIR"/"$STABLEVERSION".tar.bz2.sha256 | awk '{print$1}')"
|
||||
if ! echo "$SHA256SUM" "$STABLEVERSION.tar.bz2" | sha256sum -c
|
||||
then
|
||||
# Checksum of the downloaded file
|
||||
print_text_in_color "$ICyan" "Checking SHA256 checksum..."
|
||||
mkdir -p "$SHA256_DIR"
|
||||
curl_to_dir "$NCREPO" "$STABLEVERSION.tar.bz2.sha256" "$SHA256_DIR"
|
||||
SHA256SUM="$(tail "$SHA256_DIR"/"$STABLEVERSION".tar.bz2.sha256 | awk '{print$1}')"
|
||||
if ! echo "$SHA256SUM" "$STABLEVERSION.tar.bz2" | sha256sum -c
|
||||
then
|
||||
msg_box "The SHA256 checksums of $STABLEVERSION.tar.bz2 didn't match, please try again."
|
||||
exit 1
|
||||
fi
|
||||
# integrity of the downloaded file
|
||||
print_text_in_color "$ICyan" "Checking GPG integrity..."
|
||||
install_if_not gnupg
|
||||
mkdir -p "$GPGDIR"
|
||||
curl_to_dir "$NCREPO" "$STABLEVERSION.tar.bz2.asc" "$GPGDIR"
|
||||
chmod -R 600 "$GPGDIR"
|
||||
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys "$OpenPGP_fingerprint"
|
||||
gpg --verify "$GPGDIR/$STABLEVERSION.tar.bz2.asc" "$HTML/$STABLEVERSION.tar.bz2"
|
||||
rm -r "$SHA256_DIR"
|
||||
rm -r "$GPGDIR"
|
||||
rm -f releases
|
||||
rm -f /tmp/prerelease.version
|
||||
msg_box "The SHA256 checksums of $STABLEVERSION.tar.bz2 didn't match, please try again."
|
||||
exit 1
|
||||
fi
|
||||
# integrity of the downloaded file
|
||||
print_text_in_color "$ICyan" "Checking GPG integrity..."
|
||||
install_if_not gnupg
|
||||
mkdir -p "$GPGDIR"
|
||||
curl_to_dir "$NCREPO" "$STABLEVERSION.tar.bz2.asc" "$GPGDIR"
|
||||
chmod -R 600 "$GPGDIR"
|
||||
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys "$OpenPGP_fingerprint"
|
||||
gpg --verify "$GPGDIR/$STABLEVERSION.tar.bz2.asc" "$HTML/$STABLEVERSION.tar.bz2"
|
||||
rm -r "$SHA256_DIR"
|
||||
rm -r "$GPGDIR"
|
||||
rm -f releases
|
||||
}
|
||||
|
||||
# call like: download_script folder_variable name_of_script
|
||||
|
|
|
@ -704,11 +704,13 @@ as it's not currently possible to downgrade.\n\nPlease only continue if you have
|
|||
NCREPO="https://download.nextcloud.com/server/prereleases"
|
||||
NCVERSION=$(curl -s -m 900 $NCREPO/ | sed --silent 's/.*href="nextcloud-\([^"]\+\).zip.asc".*/\1/p' | sort --version-sort | tail -1)
|
||||
STABLEVERSION="nextcloud-$NCVERSION"
|
||||
rm -f /tmp/prerelease.version
|
||||
elif grep -q RC /tmp/prerelease.version
|
||||
then
|
||||
NCREPO="https://download.nextcloud.com/server/prereleases"
|
||||
NCVERSION=$(cat /tmp/prerelease.version)
|
||||
STABLEVERSION="nextcloud-$NCVERSION"
|
||||
rm -f /tmp/prerelease.version
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
Загрузка…
Ссылка в новой задаче