Skip to content

Commit c07f44e

Browse files
committed
check curl version and only add sessionid flag if compatible
1 parent e743bdd commit c07f44e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

makeDVD/auto.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ DOWNLOADS=(
4141
[ -n "$DEBUG" ] && set -x
4242
[ -z "$1" ] && { echo "Usage: auto.sh <dest-path>" && exit 1; }
4343
perl -MHTML::Parser -e 1 || { echo "ERROR: Perl Module HTML::Parser is not installed." && exit 1; }
44+
if [[ "$({ curl -V|awk '{print$2;exit}'; echo "7.16"; } | sort -V | head -1)" == "7.16" ]]; then
45+
CURLOPT="--no-sessionid"
46+
else
47+
CURLOPT=""
48+
fi
4449

4550
function getFormFields {
4651
perl <<EOF
@@ -114,7 +119,7 @@ for DATA in "${DOWNLOADS[@]}"; do
114119
echo "DOWNLOADING: /tmp/$FILE"
115120
DL=0
116121
if [ ! -e /tmp/$FILE ]; then
117-
curl --location-trusted --no-sessionid -b /tmp/cookies -c /tmp/cookies -A "Mozilla/5.0" -o /tmp/$FILE "$URL"
122+
curl --location-trusted $CURLOPT -b /tmp/cookies -c /tmp/cookies -A "Mozilla/5.0" -o /tmp/$FILE "$URL"
118123
DL=1
119124
fi
120125
# 3) copy or unzip file into build destination

0 commit comments

Comments
 (0)