Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b82b584

Browse files
committed
Changes on download tool.
1 parent f30dc44 commit b82b584

1 file changed

Lines changed: 20 additions & 29 deletions

File tree

.travis/download.sh

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
#!/bin/bash
22

33
PRODUCT=""
4-
AGREEMENT_URL=""
5-
DOWNLOAD_URL=""
6-
OUTPUT_FILE=""
74

85
# Call the casperjs script to return the download url.
96
# Then download the file using curl.
107
downloadFile() {
11-
downloadUrl=$(exec casperjs download.js $ORACLE_OTN_USER $ORACLE_OTN_PASSWORD $AGREEMENT_URL $DOWNLOAD_URL)
12-
#echo "DownloadURL: $downloadUrl"
13-
curl $downloadUrl -o $OUTPUT_FILE
8+
downloadUrl=$(exec casperjs download.js $ORACLE_OTN_USER $ORACLE_OTN_PASSWORD $1 $2)
9+
echo "DownloadURL: $downloadUrl"
10+
curl -O $downloadUrl
1411
}
1512

1613
#############################
@@ -24,42 +21,36 @@ while getopts "p:" OPTNAME; do
2421
done
2522

2623
if [ "$PRODUCT" = "se12c" ]; then
27-
AGREEMENT_URL="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html"
28-
DOWNLOAD_URL="http://download.oracle.com/otn/linux/oracle12c/121020/linuxamd64_12102_database_se2_1of2.zip"
29-
OUTPUT_FILE="linuxamd64_12102_database_se2_1of2.zip"
30-
downloadFile
31-
AGREEMENT_URL="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html"
32-
DOWNLOAD_URL="http://download.oracle.com/otn/linux/oracle12c/121020/linuxamd64_12102_database_se2_2of2.zip"
33-
OUTPUT_FILE="linuxamd64_12102_database_se2_2of2.zip"
34-
downloadFile
24+
agreementUrl="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html"
25+
downloadUrl="http://download.oracle.com/otn/linux/oracle12c/121020/linuxamd64_12102_database_se2_1of2.zip"
26+
downloadFile $agreementUrl $downloadUrl
27+
agreementUrl="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html"
28+
downloadUrl="http://download.oracle.com/otn/linux/oracle12c/121020/linuxamd64_12102_database_se2_2of2.zip"
29+
downloadFile $agreementUrl $downloadUrl
3530
exit 0
3631
fi
3732

3833
if [ "$PRODUCT" = "ee12c" ]; then
39-
AGREEMENT_URL="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html"
40-
DOWNLOAD_URL="http://download.oracle.com/otn/linux/oracle12c/121020/linuxamd64_12102_database_1of2.zip"
41-
OUTPUT_FILE="linuxamd64_12102_database_1of2.zip"
42-
downloadFile
43-
AGREEMENT_URL="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html"
34+
agreementUrl="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html"
35+
downloadUrl="http://download.oracle.com/otn/linux/oracle12c/121020/linuxamd64_12102_database_1of2.zip"
36+
downloadFile $agreementUrl $downloadUrl
37+
agreementUrl="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html"
4438
DOWNLOAD_URL="http://download.oracle.com/otn/linux/oracle12c/121020/linuxamd64_12102_database_2of2.zip"
45-
OUTPUT_FILE="linuxamd64_12102_database_2of2.zip"
46-
downloadFile
39+
downloadFile $agreementUrl $downloadUrl
4740
exit 0
4841
fi
4942

5043
if [ "$PRODUCT" = "xe11g" ]; then
51-
AGREEMENT_URL="http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html"
52-
DOWNLOAD_URL="https://edelivery.oracle.com/akam/otn/linux/oracle11g/xe/oracle-xe-11.2.0-1.0.x86_64.rpm.zip"
53-
OUTPUT_FILE="oracle-xe-11.2.0-1.0.x86_64.rpm.zip"
54-
downloadFile
44+
agreementUrl="http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html"
45+
downloadUrl="https://edelivery.oracle.com/akam/otn/linux/oracle11g/xe/oracle-xe-11.2.0-1.0.x86_64.rpm.zip"
46+
downloadFile $agreementUrl $downloadUrl
5547
exit 0
5648
fi
5749

5850
if [ "$PRODUCT" = "sqlcl" ]; then
59-
AGREEMENT_URL="http://www.oracle.com/technetwork/developer-tools/sqlcl/downloads/index.html"
60-
DOWNLOAD_URL="http://download.oracle.com/otn/java/sqldeveloper/sqlcl-4.2.0.16.355.0402-no-jre.zip"
61-
OUTPUT_FILE="sqlcl-4.2.0.16.355.0402-no-jre.zip"
62-
downloadFile
51+
agreementUrl="http://www.oracle.com/technetwork/developer-tools/sqlcl/downloads/index.html"
52+
downloadUrl="http://download.oracle.com/otn/java/sqldeveloper/sqlcl-4.2.0.16.355.0402-no-jre.zip"
53+
downloadFile $agreementUrl $downloadUrl
6354
exit 0
6455
fi
6556

0 commit comments

Comments
 (0)