+

Add --location parameter in Curl mode to handle redirect

Benjamin Renard [2017-04-28 15:11:48]
Add --location parameter in Curl mode to handle redirect
Filename
check_rc_upgrade.sh
diff --git a/check_rc_upgrade.sh b/check_rc_upgrade.sh
index 00f3bfc..d212bc1 100755
--- a/check_rc_upgrade.sh
+++ b/check_rc_upgrade.sh
@@ -126,7 +126,7 @@ do
 	tmpfile=`mktemp`
 	if [ $CURL -eq 1 ]
 	then
-		curl $CURL_OPTS --silent --output $tmpfile $CHECK_URL
+		curl $CURL_OPTS --location --silent --output $tmpfile $CHECK_URL
 	else
 		wget $WGET_OPTS $WGET_SSL_OPT -q $CHECK_URL -O $tmpfile
 	fi
@@ -202,7 +202,7 @@ then
 			[ $DEBUG -eq 1 ] && echo "Download new release in $DOWNLOAD_FILE"
 			if [ $CURL -eq 1 ]
 			then
-				curl $CURL_OPTS --silent --output $DOWNLOAD_FILE $DOWNLOAD_URL
+				curl $CURL_OPTS --location --silent --output $DOWNLOAD_FILE $DOWNLOAD_URL
 			else
 				wget $WGET_OPTS $WGET_SSL_OPT -q -O "$DOWNLOAD_FILE" "$DOWNLOAD_URL"
 			fi
ViewGit