Chimera's Navigator is having nightly builds released lately, so I wrote a shell script to grab it, mount the image, backup the old navigator.app, copy the new one over, and rename the disk image file to the current date.
Read the rest of the article for the script...
The script should run fine without any modifications on any OS X 10.1.4 install. Commented lines are how I have it set up on my system. Change the cd line near the beginning to change where the script saves stuff.
#! /bin/sh[Editor's note: I tested this and it works perfectly. The only caveat is to also change the path where the script looks for "Navigator" if you don't have it installed at the top level of the default Applications folder.]
/bin/echo "Beginning Chimera Nightly Download: `date`"
/bin/echo "Changing to download folder"
cd $HOME
#cd $HOME/Downloads/Chimera
/bin/echo "pwd is: `pwd`"
/bin/echo "Downloading Chimera: `date`"
/usr/bin/curl -O ftp://ftp.mozilla.org/pub/chimera/nightly/latest-trunk/Chimera.dmg.gz
#/usr/local/bin/wget -c ftp://ftp.mozilla.org/pub/chimera/nightly/latest-trunk/Chimera.dmg.gz
if [ -f Chimera.dmg.gz ];then
/usr/bin/gunzip Chimera.dmg.gz
# /bin/echo "Converting Chimera DMG: `date`"
# /usr/bin/hdiutil convert -format UDZO -o temp.dmg Chimera.dmg
# /bin/rm Chimera.dmg
# /bin/mv temp.dmg Chimera.dmg
/bin/echo "Mounting Chimera DMG: `date`"
thedisk=`/usr/bin/hdid Chimera.dmg | /usr/bin/awk '{print $1}' | /usr/bin/head -n1`
/bin/echo "Testing to see if Chimera is running."
/bin/ps -xa | /usr/bin/grep Navigator | /usr/bin/grep -v grep > /dev/null
if [ $? -eq 0 ]
then
/bin/echo "Getting Chimera PID"
killme=`/bin/ps -xa | /usr/bin/grep Navigator | /usr/bin/grep -v grep | /usr/bin/cut -c1-5`
/bin/echo "Killing Chimera"
/bin/kill $killme
else
/bin/echo "Chimera not running"
fi
/bin/echo "Backing up old Chimera"
/usr/bin/tar -czf /Applications/NavOld.tar.gz /Applications/Navigator.app
/bin/echo "Removing old Chimera"
/bin/rm -rf /Applications/Navigator.app
/bin/echo "Copying Chimera Application: `date`"
# /usr/local/sbin/CpMac -r "/Volumes/Chimera/Navigator.app" "/Applications/"
/usr/bin/ditto "/Volumes/Chimera/Navigator.app" "/Applications/"
/bin/echo "Ejecting Chimera DMG: `date`"
/usr/bin/hdiutil eject $thedisk
/bin/echo "Renaming Chimera DMG"
if [ -f "Chimera.dmg" ]; then
thedate=`/bin/date +%D | /usr/bin/tr "/" "-"`
/bin/mv -f "Chimera.dmg" "Chimera.$thedate.dmg"
/bin/echo "Renamed to Chimera.$thedate.dmg"
fi
/bin/echo "End Chimera download: `date`"
fi
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020603091306675