ATV2 and iOS nightly build semi automatic update scripts
#31
I was coming into the help section looking to post my problem with not being able to update. This completely solves my problem. What great work and solid little script.
Thank you very much durniplot
Reply
#32
davilla Wrote:dpkg -i will not run, need user root and you are user mobile for xbmc. Also, remember that iOS restrictions still apply and there are some locations that you do not have full read/write permission.

Also, under iOS, you are not permitted to fork.

Yeah, I realized that. I tried to tiptoe around that by doing a sudo with password.

Code:
echo alpine | sudo -S "dpkg -i $xbmcdeb" > _installoutput.txt 2>&1

Got hit with this discouraging output:

Code:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:
mobile is not in the sudoers file.  This incident will be reported.

I could look at the sudoers file perhaps, but the idea of this thing was to make things easy. I guess it's a dead end. I knew there was a reason I couldn't find this script already Tongue
Repo - A few simple script to do library update.
Reply
#33
durniplot Wrote:So, I like to automate things, and I hate to type the same stuff over and over. The script below is what I just put together to simplify updating to the latest nightly build (from the official repository, that is http://mirrors.xbmc.org/nightlies/darwin/atv2/):

Code:
#!/bin/sh
xbmcdir=http://mirrors.xbmc.org/nightlies/darwin/atv2
wget -q $xbmcdir
xbmcdeb=$(cat index.html | gawk 'match($0, ">(xbmc-.*-.*-master-atv2.deb)<", a) {print a[1]}' | head -n 1)
rm index.html
wget $xbmcdir/$xbmcdeb
dpkg -i $xbmcdeb
rm $xbmcdeb

What this script does is to first download the file listing from the atv2 builds directory, parse out the name of the topmost build (which should be the newest), and then download and install this package.

I am sure there is plenty of room for improvement, I haven't really made a shell script in about 10 years, so my script-fu is kinda rusty... But hey, this works for me. :-)

The easiest way to get this script on your ATV2 is probably to ssh to the box (I use PuTTY for this) and simply paste the following into your terminal (everything in one go works fine) and press enter:

Code:
rm xbmcup.sh
echo '#!/bin/sh' >> ./xbmcup.sh
echo "xbmcdir=http://mirrors.xbmc.org/nightlies/darwin/atv2" >> ./xbmcup.sh
echo "wget -q \$xbmcdir" >> ./xbmcup.sh
echo "xbmcdeb=\$(cat index.html | gawk 'match(\$0, \">(xbmc-.*-.*-master-atv2.deb)<\", a) {print a[1]}' | head -n 1)"  >> ./xbmcup.sh
echo "rm index.html" >> ./xbmcup.sh
echo "wget \$xbmcdir/\$xbmcdeb" >> ./xbmcup.sh
echo "dpkg -i \$xbmcdeb" >> ./xbmcup.sh
echo "rm \$xbmcdeb" >> ./xbmcup.sh
chmod 755 ./xbmcup.sh

Do remember to press enter, or your script won't be executable.

Now, whenever you'd like to update, you just ssh to your ATV2 and type this:

Code:
./xbmcup.sh

With PuTTY, and probably other ssh clients aswell, you can even tell it to run the above command automatically when you connect to the ATV2, if you'd prefer not to type anything at all except login and password. In session settings, go to Connection > SSH and put ./xbmcup.sh in "Remote command" and save your session). Now, when you connect with this session, instead of an interactive shell, PuTTY will trigger the script, and then disconnect and close its window when the update is finished.

Here's a URL to a picture showing the correct spot in the settings dialog:
http://www.ats.ucla.edu/clusters/common/...ty_ssh.jpg

For absolutely no typing, pair this with ssh keys instead of a logon password and you've got a completely automated updater triggered from your PC.

I will be adapting the script for the iOS (iPad) builds later - if there is any interest I'll post that one, too.

Best regards,
Durniplot

hi mate, im a little confused with your two scripts, do i just copy and past the first script then press enter, and do the same with the next script,or is this just for the top script only, ie do i only use the one or do i need to use both.??

thanks.
Reply
#34
Quote:hi mate, im a little confused with your two scripts, do i just copy and past the first script then press enter, and do the same with the next script,or is this just for the top script only, ie do i only use the one or do i need to use both.??

One is for AppleTV, one is for iPad. Pick one Smile

Durniplot.
Reply
#35
durniplot Wrote:One is for AppleTV, one is for iPad. Pick one Smile

Durniplot.

oh i see, but which one is for atv2.?

thanks
Reply
#36
this one yes...?

rm xbmcup.sh
echo '#!/bin/sh' >> ./xbmcup.sh
echo "xbmcdir=http://mirrors.xbmc.org/nightlies/darwin/atv2" >> ./xbmcup.sh
echo "wget -q \$xbmcdir" >> ./xbmcup.sh
echo "xbmcdeb=\$(cat index.html | gawk 'match(\$0, \">(xbmc-.*-.*-master-atv2.deb)<\", a) {print a[1]}' | head -n 1)" >> ./xbmcup.sh
echo "rm index.html" >> ./xbmcup.sh
echo "wget \$xbmcdir/\$xbmcdeb" >> ./xbmcup.sh
echo "dpkg -i \$xbmcdeb" >> ./xbmcup.sh
echo "rm \$xbmcdeb" >> ./xbmcup.sh
chmod 755 ./xbmcup.sh
Reply
#37
leezy Wrote:this one yes...?
...
echo "xbmcdir=http://mirrors.xbmc.org/nightlies/darwin/atv2" >> ./xbmcup.sh
...

This one, indeed.

Best regards,
Durniplot.
Reply
#38
durniplot Wrote:So, I like to automate things, and I hate to type the same stuff over and over. The script below is what I just put together to simplify updating to the latest nightly build (from the official repository, that is http://mirrors.xbmc.org/nightlies/darwin/atv2/):

Code:
#!/bin/sh
xbmcdir=http://mirrors.xbmc.org/nightlies/darwin/atv2
wget -q $xbmcdir
xbmcdeb=$(cat index.html | gawk 'match($0, ">(xbmc-.*-.*-master-atv2.deb)<", a) {print a[1]}' | head -n 1)
rm index.html
wget $xbmcdir/$xbmcdeb
dpkg -i $xbmcdeb
rm $xbmcdeb

What this script does is to first download the file listing from the atv2 builds directory, parse out the name of the topmost build (which should be the newest), and then download and install this package.

I am sure there is plenty of room for improvement, I haven't really made a shell script in about 10 years, so my script-fu is kinda rusty... But hey, this works for me. :-)

The easiest way to get this script on your ATV2 is probably to ssh to the box (I use PuTTY for this) and simply paste the following into your terminal (everything in one go works fine) and press enter:

Code:
rm xbmcup.sh
echo '#!/bin/sh' >> ./xbmcup.sh
echo "xbmcdir=http://mirrors.xbmc.org/nightlies/darwin/atv2" >> ./xbmcup.sh
echo "wget -q \$xbmcdir" >> ./xbmcup.sh
echo "xbmcdeb=\$(cat index.html | gawk 'match(\$0, \">(xbmc-.*-.*-master-atv2.deb)<\", a) {print a[1]}' | head -n 1)"  >> ./xbmcup.sh
echo "rm index.html" >> ./xbmcup.sh
echo "wget \$xbmcdir/\$xbmcdeb" >> ./xbmcup.sh
echo "dpkg -i \$xbmcdeb" >> ./xbmcup.sh
echo "rm \$xbmcdeb" >> ./xbmcup.sh
chmod 755 ./xbmcup.sh

Do remember to press enter, or your script won't be executable.

Now, whenever you'd like to update, you just ssh to your ATV2 and type this:

Code:
./xbmcup.sh

With PuTTY, and probably other ssh clients aswell, you can even tell it to run the above command automatically when you connect to the ATV2, if you'd prefer not to type anything at all except login and password. In session settings, go to Connection > SSH and put ./xbmcup.sh in "Remote command" and save your session). Now, when you connect with this session, instead of an interactive shell, PuTTY will trigger the script, and then disconnect and close its window when the update is finished.

Here's a URL to a picture showing the correct spot in the settings dialog:
http://www.ats.ucla.edu/clusters/common/...ty_ssh.jpg

For absolutely no typing, pair this with ssh keys instead of a logon password and you've got a completely automated updater triggered from your PC.

I will be adapting the script for the iOS (iPad) builds later - if there is any interest I'll post that one, too.

Best regards,
Durniplot

will this fix atv2 black 1.2 as well..Huh

thanks
Reply
#39
leezy Wrote:will this fix atv2 black 1.2 as well..Huh

thanks

no.
Reply
#40
ok thanks, an update came through this morning and its all good now Smile
Reply
#41
It's been quite a while since we were having sweet, sweet dailies, so I wanted to let you know that the update scripts at the beginning of this thread are still working.

Also, as a reminder, you need some extra tools installed. You can get these from cydia (in dev. mode) - search for apt, wget and gawk.

Best regards,
Durniplot.
Reply
#42
Great work on the script! I still use it, but wanted to adapt it for snapshots and not being that great with linux scripting (yet) am having some issues. Here's what I have so far..

Code:
rm snapshot.sh
echo '#!/bin/sh' >> ./snapshot.sh
echo "xbmcdir=http://mirrors.xbmc.org/snapshots/darwin/atv2" >> ./snapshot.sh
echo "wget -q \$xbmcdir" >> ./snapshot.sh
echo "xbmcdeb=\$(cat index.html | gawk 'match(\$0, \">(org.xbmc.xbmc-atv2_12.0-0~a*_iphoneos-arm.deb)<\", a) {print a[1]}' | head -n 1)"  >> ./snapshot.sh
echo "rm index.html" >> ./snapshot.sh
echo "wget \$xbmcdir/\$xbmcdeb" >> ./snapshot.sh
echo "dpkg -i \$xbmcdeb" >> ./snapshot.sh
echo "rm \$xbmcdeb" >> ./snapshot.sh
chmod 755 ./snapshot.sh

Any suggestions?
Reply
#43
Is there any chance that u can rebuild this script so it will fetch the monthly releases instead? Seems abit more stable to run the monthlies than nightlies Wink

Thanks in advice

Hampfred
Reply
#44
Alright.

Here's a script modified for fetching monthlies. This one is for ios (iPad in my case), NOT atv2.

Code:
#!/bin/sh
xbmcdir=http://mirrors.xbmc.org/snapshots/darwin/ios/
wget -q $xbmcdir
xbmcdeb=$(cat index.html | gawk 'match($0, "<a href=\"(org.xbmc.xbmc-ios_.*.0-0.*_iphoneos-arm.deb)\">", a) {print a[1]}' | gawk 'NR==1{print }')
rm index.html
wget $xbmcdir/$xbmcdeb
dpkg -i $xbmcdeb
rm $xbmcdeb

Easiest way to get it on your iDevice, is to paste the following in a terminal window.

Code:
rm xbmcupmon.sh
echo '#!/bin/sh' >> ./xbmcupmon.sh
echo "xbmcdir=http://mirrors.xbmc.org/snapshots/darwin/ios/" >> ./xbmcupmon.sh
echo "wget -q \$xbmcdir" >> ./xbmcupmon.sh
echo "xbmcdeb=\$(cat index.html | gawk 'match(\$0, \"<a href=\\\"(org.xbmc.xbmc-ios_.*.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

Now run ./xbmcupmon.sh to get the newest monthly snapshot. For more info, see first couple of posts in this thread.

Durniplot.
Reply
#45
Seems good, but the thing is I am on Apple tv 2. Sorry I didnt tell you. But maybe I can figure it out when i get home.

Cheers!
Reply

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