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

Skip to content

Commit e008669

Browse files
Update install_java.sh
1 parent 721c53e commit e008669

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

install_java.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if [[ -n "$1" ]]; then
2929
fi
3030
fi
3131

32-
# set download extention
32+
# set download extension
3333
if [[ -n "$2" ]]; then
3434
if [[ "$2" == "tar" ]]; then
3535
EXT="tar.gz"
@@ -57,15 +57,15 @@ if [[ -z "$DOWNLOAD_URL4" ]]; then
5757
exit 1
5858
fi
5959
# set download file name
60-
JAVA_INSTALL=$(echo $DOWNLOAD_URL4|cut -d "/" -f 8)
60+
JAVA_INSTALL=$(basename $DOWNLOAD_URL4)
6161

6262
if [[ "$EXT" == "rpm" ]]; then
6363

6464
# download java
6565
echo -e "\n\e[32mDownloading\e[0m: $DOWNLOAD_URL4"
6666
while true;
6767
do echo -n .;sleep 1;done &
68-
cd /tmp; wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" $DOWNLOAD_URL4 > /dev/null 2>&1
68+
cd /tmp; wget -q --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" $DOWNLOAD_URL4 -O $JAVA_INSTALL > /dev/null 2>&1
6969
kill $!; trap 'kill $!' SIGTERM;
7070
# install rpm
7171
echo -e "\n\e[32mInstalling\e[0m: $JAVA_INSTALL\r"
@@ -100,7 +100,7 @@ elif [[ "$EXT" == "tar" || "$EXT" == "tar.gz" ]]; then
100100
echo -e "\n\e[32mDownloading\e[0m: $DOWNLOAD_URL4"
101101
while true;
102102
do echo -n .;sleep 1;done &
103-
cd /opt; wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" $DOWNLOAD_URL4 > /dev/null 2>&1
103+
cd /opt; wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" $DOWNLOAD_URL4 -O $JAVA_INSTALL > /dev/null 2>&1
104104
kill $!; trap 'kill $!' SIGTERM;
105105
# extract the tar
106106
echo -e "\n\e[32mExtracting\e[0m: $JAVA_INSTALL\r"

0 commit comments

Comments
 (0)