Skip to content

Commit 2d36913

Browse files
committed
fix #2775
1 parent fc9c4d4 commit 2d36913

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

lib.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,12 +1437,23 @@ do
14371437
done
14381438

14391439
# Download the file
1440+
# Use GitHub releases for NC 32+ for faster downloads
1441+
# GitHub URL format: https://github.com/nextcloud-releases/server/releases/download/v{VERSION}/nextcloud-{VERSION}.tar.bz2
1442+
if [ "${NCVERSION%%.*}" -ge 32 ]
1443+
then
1444+
NCGITHUB="https://github.com/nextcloud-releases/server/releases/download"
1445+
DOWNLOAD_URL="$NCGITHUB/v$NCVERSION/$STABLEVERSION.tar.bz2"
1446+
print_text_in_color "$ICyan" "Downloading $STABLEVERSION from GitHub releases (faster)..."
1447+
else
1448+
DOWNLOAD_URL="$NCREPO/$STABLEVERSION.tar.bz2"
1449+
print_text_in_color "$ICyan" "Downloading $STABLEVERSION..."
1450+
fi
1451+
14401452
rm -f "$HTML/$STABLEVERSION.tar.bz2"
14411453
cd $HTML
1442-
print_text_in_color "$ICyan" "Downloading $STABLEVERSION..."
14431454
if network_ok
14441455
then
1445-
curl -fSLO --retry 3 "$NCREPO"/"$STABLEVERSION".tar.bz2
1456+
curl -fSLO --retry 3 "$DOWNLOAD_URL"
14461457
else
14471458
msg_box "There seems to be an issue with your network, please try again later.\nThis script will now exit."
14481459
exit 1

0 commit comments

Comments
 (0)