From eafde74c1d4ab7d2e476196bfb46f98cfe2a14a5 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Sat, 31 Dec 2016 00:27:56 +0100 Subject: [PATCH] set timeout to curl (15 minutes) --- nextcloud_update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nextcloud_update.sh b/nextcloud_update.sh index c0d656f5..2d8b86a1 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -22,7 +22,7 @@ NCREPO="https://download.nextcloud.com/server/releases" SECURE="$SCRIPTS/setup_secure_permissions_nextcloud.sh" # Versions CURRENTVERSION=$(sudo -u www-data php $NCPATH/occ status | grep "versionstring" | awk '{print $3}') -NCVERSION=$(curl -s $NCREPO/ | tac | grep unknown.gif | sed 's/.*"nextcloud-\([^"]*\).zip.sha512".*/\1/;q') +NCVERSION=$(curl -s --max-time 900 $NCREPO/ | tac | grep unknown.gif | sed 's/.*"nextcloud-\([^"]*\).zip.sha512".*/\1/;q') # Must be root [[ `id -u` -eq 0 ]] || { echo "Must be root to run script, in Ubuntu type: sudo -i"; exit 1; } @@ -44,7 +44,7 @@ fi # Upgrade Nextcloud echo "Checking latest released version on the Nextcloud download server and if it's possible to download..." -curl -s $NCREPO/nextcloud-$NCVERSION.tar.bz2 > /dev/null +curl -s --max-time 900 $NCREPO/nextcloud-$NCVERSION.tar.bz2 > /dev/null if [ $? -eq 0 ]; then echo -e "\e[32mSUCCESS!\e[0m" else