Created
June 2, 2017 09:29
-
-
Save andygock/efeebd51807de116b3e1e76bdc18b31e to your computer and use it in GitHub Desktop.
Bash script: Download latest JRE offline installer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Download latest JRE for Windows x64 | |
page="http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html" | |
# Edit this for other platforms | |
url=$(curl -s "$page" \ | |
| grep "downloads\[.*jre-.*filepath" | cut -d ',' -f 3 | cut -d '"' -f 4 | grep "x64.exe$") | |
wget --no-cookies --no-check-certificate --header \ | |
"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \ | |
"$url" -O "${url##*/}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment