ATV2 and iOS nightly build semi automatic update scripts
#46
I tried to build the monthly for ATV2 and got it to work, just took your script and changed two lines, but here it is if someone needs it.
Code:
rm xbmcupmon.sh
echo '#!/bin/sh' >> ./xbmcupmon.sh
echo "xbmcdir=http://mirrors.xbmc.org/snapshots/darwin/atv2//" >> ./xbmcupmon.sh
echo "wget -q \$xbmcdir" >> ./xbmcupmon.sh
echo "xbmcdeb=\$(cat index.html | gawk 'match(\$0, \"<a href=\\\"(org.xbmc.xbmc-atv2_.*.0-0.*_iphoneos-arm.deb)\\\">\", a) {print a[1]}' | gawk 'NR==1{print $1}')"  >> ./xbmcupmon.sh
echo "rm index.html" >> ./xbmcupmon.sh
echo "wget \$xbmcdir/\$xbmcdeb" >> ./xbmcupmon.sh
echo "dpkg -i \$xbmcdeb" >> ./xbmcupmon.sh
echo "rm \$xbmcdeb" >> ./xbmcupmon.sh
chmod 755 ./xbmcupmon.sh

and then just run ./xbmcupmon.sh and u should be good.
Thanks for this wonderful script, durniplot.
Reply
#47
(2012-09-10, 19:31)Hampfred Wrote: I tried to build the monthly for ATV2 and got it to work, just took your script and changed two lines, but here it is if someone needs it.
Code:
rm xbmcupmon.sh
echo '#!/bin/sh' >> ./xbmcupmon.sh
echo "xbmcdir=http://mirrors.xbmc.org/snapshots/darwin/atv2//" >> ./xbmcupmon.sh
echo "wget -q \$xbmcdir" >> ./xbmcupmon.sh
echo "xbmcdeb=\$(cat index.html | gawk 'match(\$0, \"<a href=\\\"(org.xbmc.xbmc-atv2_.*.0-0.*_iphoneos-arm.deb)\\\">\", a) {print a[1]}' | gawk 'NR==1{print $1}')"  >> ./xbmcupmon.sh
echo "rm index.html" >> ./xbmcupmon.sh
echo "wget \$xbmcdir/\$xbmcdeb" >> ./xbmcupmon.sh
echo "dpkg -i \$xbmcdeb" >> ./xbmcupmon.sh
echo "rm \$xbmcdeb" >> ./xbmcupmon.sh
chmod 755 ./xbmcupmon.sh

and then just run ./xbmcupmon.sh and u should be good.
Thanks for this wonderful script, durniplot.

That just downloaded the index.html file not the deb
Reply
#48
What? It says in the terminal its downloading a deb, and installing it..

http://imgur.com/ncLKn

Image
Reply
#49
Awesome script, thank you.

I wanted to practice my bash commands so if anyone is interested I wrote two one-liners for updating the latest nightly or snapshot:

Nightly:
Code:
xDir=xbmcdeb && URL=http://mirrors.xbmc.org/nightlies/darwin/atv2/ && snapshot=$(curl $URL | sed -n "s/.*\(xbmc.*deb\).*/\1/p" | sed -n 1p) && wget $URL$snapshot -P ./$xDir/ && dpkg -i ./$xDir/$snapshot && rm ./$xDir/$snapshot && reboot

Snapshot:
Code:
xDir=xbmcsnapshot && URL=http://mirrors.xbmc.org/snapshots/darwin/atv2/ && snapshot=$(curl $URL | sed -n "s/.*\(org.*deb\).*/\1/p" | sed -n 1p) && wget $URL$snapshot -P ./$xDir/ && dpkg -i ./$xDir/$snapshot && rm ./$xDir/$snapshot && reboot

These should work for any version of XBMC, it's just important that the code for snapshot is used for snapshots and nightly for nightlies (and correct URL placed in the URL=$() [with trailing backslash]). I'm not entirely sure how often or if ever they change the syntax of the file naming scheme for Snapshots and Nightlies, but I'm assuming that it doesn't [change] often. Snapshots depend on the filename beginning with org and Nightlies depend on the filename beginning with xbmc. -- See below -- updated so that same code can be used for any package, the correct URL just needs to be inputted


Also if you've ever wanted to see what version of XBMC you're running from the command line, this should give you some info:

Code:
dpkg -l | grep "XBMC M"

12.0-0~beta1 reports for nightlies, and 12.0-0~alpha7 for the latest snapshot.

Edit:
Redoing the search expression, the following code should work for any package. The URL just needs to be updated with the correct URL. The following has the URL for ATV2 Snapshots, all that would need to be changed is URL=http://mirrors.xbmc.org/nightlies/darwin/atv2/ to have it work for nightlies:
Code:
xDir=xbmcdeb && URL=http://mirrors.xbmc.org/snapshots/darwin/atv2/ && package=$(curl $URL | sed -n "s/.*\(f=.*.deb\).*/\1/p" | sed -n 1p | sed -e 's/<//' -e 's/f=\"//') && wget $URL$package -P ./$xDir/ && dpkg -i ./$xDir/$package && rm ./$xDir/$package && reboot
ATV2 running XBMC Eden (Skin: Quartz3)
Windows 7 running XBMC Eden (custom setup as I'm basically running it as a service)
MySQL installed on Windows 7 for sharing libraries
iOS Specific FAQ | Alternative ATV2 keymap | Default ATV2 keymap
Post log files to Pastebin

Image
Reply

Logout Mark Read Team Forum Stats Members Help
ATV2 and iOS nightly build semi automatic update scripts1