Last active
June 2, 2017 09:34
-
-
Save andygock/e77f7b5ee65e564037688d1e00b30974 to your computer and use it in GitHub Desktop.
Bash script: Download latest stable LibreOffice for Windows x86
This file contains hidden or 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 stable LibreOffice for Windows x86 | |
# | |
urla=$(curl -s "https://www.libreoffice.org/download/download/" \ | |
| grep "option.*type=win-x86\&" | head -n 2 | cut -d '"' -f 2 | tail -n 1) | |
urlb=$(curl -s "$urla" | grep "\.msi" | grep -v "torrent" | tail -n 1 | cut -d '"' -f 6) | |
urlc=$(curl -s "$urlb" | grep "Your download" | cut -d "'" -f 2) | |
if [ "$urlc" = "" ]; then | |
echo >&2 "Could not extract download URL" | |
exit 1 | |
fi | |
wget "$urlc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment