Rockbox General > Rockbox General Discussion

updating rockbox from osx...

(1/1)

lbm:
...can be a pain if you wan't to do it with the finder because of the hidden files. So I started a small script. Don't know really where to put it so I'll put it in the general discussion.

Maybe someone sophisticated with apple scripts can use it to make it fancy or it might be adopted for linux users or whatever. And I don't know the time of the builds on the rockbox-server so maybe someone wants to get the timezone thing straight :).


--- Code: ---#!/bin/bash
#
# install the newest (when the date thingy works) rockbox daily build on the player

declare -i MYTIMEZONE

# please set your timezone and the name of your device
MYTIMEZONE=+2
DEVICENAME=IAUDIO # actually this is the mountpoint - the apple automounter uses the "harddisk name"
DEVICE=iaudiox5 # and this is more or less the download-filename

MYTIMEZONE=$MYTIMEZONE*3600

FILENAME=rockbox-$DEVICE-`perl -e '@T=gmtime(time-82800+$MYTIMEZONE);printf("20%02d%02d%02d",($T[5]+1900)%100,$T[4]+1,$T[3])'`.zip
# and here is a looot to improve but my shellscripting skills are not that good :)

if [ ! -f $FILENAME ]; then
        echo "Rockbox file does not exist. Trying to download $FILENAME"
        wget --quiet http://download.rockbox.org/daily/iaudiox5/$FILENAME
fi
if [ -f $FILENAME ]; then
        if [ -d /Volumes/$DEVICENAME/ ]; then
                echo "Now extracting the new version to your iAudio device..."
                unzip -oqd /Volumes/$DEVICENAME/ $FILENAME
                ERROR=$?
                if [ $ERROR -eq 0 ]; then
                        echo "Rockbox updated and installed sucessfully."
                        rm $FILENAME
                        echo "Local version of $FILENAME deleted."
                else
                        echo "An unknown error occured unzipping the file."
                        echo "File $FILENAME has been kept."
                fi
        else
                echo "iAudio not connected..."
                echo "The downloaded file has been kept."
                echo "Rerun this script to install to device and"
                echo "delete the file."
        fi
else
        echo "File could not be downloaded..."
        echo "Maybe you want to try again later."
fi

--- End code ---

Or maybe it is complety unuseful for everybody, but I think it makes updating a bit more comfortable ;) and maybe one want's to add some neat tricks to it (like preserving the config file or stuff like that) because right now it is just an idea and not a cool rockbox updater implemenation.

Cheers, Thorsten

bluebrother:
Why don't you put this in the wiki? I think that's a better place to put this in ;)

Navigation

[0] Message Index

Go to full version