Created
December 22, 2010 11:31
-
-
Save saml/751412 to your computer and use it in GitHub Desktop.
automatically downloads and updates chromium nightly
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 | |
d="$HOME/opt/chromium" | |
v="$d/VERSION" | |
u="http://build.chromium.org/f/chromium/snapshots/chromium-rel-linux" | |
downloads="$HOME/Downloads" | |
unzipped="$downloads/chrome-linux" | |
zip_file="$downloads/chrome-linux.zip" | |
latest="$(curl "$u/LATEST" 2> /dev/null)" | |
echo "Latest version: $latest" | |
if [[ -f "$v" ]] | |
then | |
local_version="$(cat "$v")" | |
else | |
local_version="0" | |
fi | |
echo "Local version: $local_version" | |
if (( "$latest" > "$local_version" )) | |
then | |
wget "$u/$latest/chrome-linux.zip" -O "$zip_file" | |
unzip "$zip_file" -d "$downloads" | |
echo "moving $unzipped to $d" | |
rm -rf "$d" | |
rm "$zip_file" | |
mv "$unzipped" "$d" | |
echo "$latest" > "$v" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment