Skip to content

Commit

Permalink
check curl version and only add sessionid flag if compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
ardentperf committed Oct 1, 2012
1 parent e743bdd commit c07f44e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion makeDVD/auto.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ DOWNLOADS=(
[ -n "$DEBUG" ] && set -x [ -n "$DEBUG" ] && set -x
[ -z "$1" ] && { echo "Usage: auto.sh <dest-path>" && exit 1; } [ -z "$1" ] && { echo "Usage: auto.sh <dest-path>" && exit 1; }
perl -MHTML::Parser -e 1 || { echo "ERROR: Perl Module HTML::Parser is not installed." && exit 1; } perl -MHTML::Parser -e 1 || { echo "ERROR: Perl Module HTML::Parser is not installed." && exit 1; }
if [[ "$({ curl -V|awk '{print$2;exit}'; echo "7.16"; } | sort -V | head -1)" == "7.16" ]]; then
CURLOPT="--no-sessionid"
else
CURLOPT=""
fi


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

0 comments on commit c07f44e

Please sign in to comment.