Skip to content

Instantly share code, notes, and snippets.

@saml
Created December 22, 2010 11:31
Show Gist options
  • Save saml/751412 to your computer and use it in GitHub Desktop.
Save saml/751412 to your computer and use it in GitHub Desktop.
automatically downloads and updates chromium nightly
#!/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