Chromium auto update script

Discussion in 'Mac Apps and Mac App Store' started by jman240, Sep 17, 2009.

  1. jman240 macrumors 6502a

    Joined:
    May 26, 2009
    #1
    Dunno if this is the right place to put this but I thought it may be useful to someone.

    This script (save as .sh file and make it executable via 'chmod +x script.sh' command) downloads the latest chrome file, installs it (ignore the errors) and then deletes the install copy. It works for me, if you have extra time you can probably convert it to an automator action or something of the like.

    tested on 10.6.1 snow leopard

    Code:
    #!/bin/bash
    mkdir ~/Desktop/chromedownload
    cd ~/Desktop/chromedownload 
    curl http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST -o ~/Desktop/chromedownload/LATEST --silent
    LATEST=`cat ~/Desktop/chromedownload/LATEST` 
    curl http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/$LATEST/chrome-mac.zip -o ~/Desktop/chromedownload/chrome-mac.zip --silent 
    unzip -qq ~/Desktop/chromedownload/chrome-mac.zip 
    cp -R ~/Desktop/chromedownload/chrome-mac/Chromium.app /Applications
    rm -rf ~/Desktop/chromedownload
     
  2. Mr.SelfDestruct macrumors newbie

    Joined:
    Sep 19, 2009
    #2
    For my own usage, I took this script and added some functionality.
    - Added more verbose feedback while updating
    - Compares Current installed version with newest available and will not install the same version again. (Saves Bandwidth)
    - Prints old version & new for comparison's sake.
    - Probably more things, but just figure it out yourself.

    Code:
    #!/bin/bash
    if [ -e "/Applications/Chromium.app/Contents/Info.plist" ];then 
    	chk=`echo "1"` 
    	else 
    	chk=`echo "0"` 
    fi
    if [ "$chk" -eq "1" ];then 
    	old=`/usr/libexec/PlistBuddy -c 'Print :SVNRevision' /Applications/Chromium.app/Contents/Info.plist` 
    	else 
    	old=`echo "0"` 
    fi
    echo "Creating /tmp/chromedownload..."
    mkdir /tmp/chromedownload && cd /tmp/chromedownload
    echo "Checking Latest Build Number..."
    curl http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST -o /tmp/chromedownload/LATEST --silent && LATEST=`cat /tmp/chromedownload/LATEST`
    if [ "$LATEST" -eq "$old" ];then
    	echo "Cleaning Up..."
    	rm -rf /tmp/chromedownload
    	echo "You are Already Running the Latest Build. ($LATEST)"
    	exit
    else
    	echo "Downloading Build $LATEST..."
    	curl http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/$LATEST/chrome-mac.zip -o /tmp/chromedownload/chrome-mac.zip --progress-bar
    	echo "Unzipping..."
    	unzip -qq -o /tmp/chromedownload/chrome-mac.zip
    	echo "Copying to /Applications..."
    	cp -R /tmp/chromedownload/chrome-mac/Chromium.app /Applications
    	echo "Removing /tmp/chromedownload..."
    	rm -rf /tmp/chromedownload
    	if [ "$chk" -eq "1" ];then 
    		echo "Chromium has been Updated from Build $old to Build $LATEST."
    		else
    		echo "Chromium has been Updated to Build $LATEST."
    	fi
    	exit
    fi
    fi
     
  3. ehunt123 macrumors newbie

    Joined:
    Dec 7, 2009
    #3

Share This Page