Jump to content


Photo

Update option in .xml files ???


  • Please log in to reply
27 replies to this topic

#1 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 12 November 2007 - 17:11

What does actually this option do, in top of the .xml files???
Can it be usefull for such a way, in a ppanel?? Does it used for the update procedure of the current ppanel???
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #2 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 12 November 2007 - 18:18

What does actually this option do, in top of the .xml files???
Can it be usefull for such a way, in a ppanel?? Does it used for the update procedure of the current ppanel???

The update line is used for "automatic update". I think you've found it in software.xml. It will download the tarball (which contains the PPanel) at the specified url if a new version is available. To let this work, you will also need to host a .ver file on your server which contains a version number and md5 sum (see /var/etc/software.ver as example).
Note that the automatic update influences ALL the PPanels installed which support this. So if you select "Enable automatic menu downloads" in Software Management, it will work for all PPanels.
Do you need more infomation about this? It's for internal PLi use for Software Management and Backup/restore.
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Update option in .xml files ??? #3 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 12 November 2007 - 19:39

Actually i am making a mother ppanel as @Hemertje suggested me, containig all the ppanels my team have made, and i intend to make it autoupdated.
It contains already the options to enabe or disable the autoupdate procedure. Also i have made a simple script which is called when we want to update the panel. The problem is how to call this script when i run the panel and the autoupdate option is enabled. I thought that i must use a RunAfterOut option which calls this script and checks if a new version is available to download. But i get an output screen on every exit of the panel (as expected) even there is a new version or not. This is very annoying. So my question had to do to that point.

I still can not understand how ppanelupdate.sh is called (the exact procedure) using that <update> option. Am i missing anything else ?? If i use that option, how can i make my panel to call mine autoupdate script file ??? I think that i am not able to do it because your trick taking place via an internal standard procedure. Am i right ???
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #4 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 12 November 2007 - 20:00

On seccond thought, i think that if i use a RunBefore option which call my script and via this script is created a help null file in case of existance of a new panel, then using comment option with condition the existance of that help null file, i will be able to give the information to the user that a new panel is already dowloaded ?? Am i right now ????
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #5 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 12 November 2007 - 20:26

You don't need a own script of any RunBefore/RunAfter. You just need this structure:

<directory name="...">
<update url="http://myserver/ppanel.tar.gz" target="/" />
[...] your own things here [...]
<execute name="Download latest menu" condition="[ ! -f /var/etc/ppanelautodownload ]" target="ppanelupdate.sh http://myserver/ppanel.tar.gz /; rm -f /tmp/ppanelrefresh" confirmation="Are you sure to download the latest menu?" quit="restart" helptext="Download the latest PPanel"/>
<execute name="Enable automatic menu downloads" condition="[ ! -f /var/etc/ppanelautodownload ]" target="touch /var/etc/ppanelautodownload; echo Automatic downloads enabled" quit="restart" helptext="Automatically download menus if a new version is available"/>
<execute name="Disable automatic menu downloads" condition="[ -f /var/etc/ppanelautodownload ]" target="rm -f /var/etc/ppanelautodownload; echo Automatic downloads disabled" quit="restart" helptext="Disable the automatic download of menus"/>
</directory>


So http://myserver/ppanel.tar.gz must contain all PPanels. First try this and see if "Download latest menu" works. If you got that working I'll explain how to make a .ver file.
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Update option in .xml files ??? #6 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 12 November 2007 - 21:07

................... If you got that working I'll explain how to make a .ver file.


Thank you very much dAF. Tottaly cleared !!!
No need to explain me anything about the ver file.
Here is a small script i made, just to make my xxxx.ver file easily ...
#!/bin/sh
VERFILE=`echo $2 | sed s/.tar.gz/.ver/`
echo "VERSION=$1" > $VERFILE
md5sum $2 >> $VERFILE
exit 0

I gave it the name make_ver.sh and i run it as follows :
make_ver.sh 001 GSF_Multi_Ppanels.tar.gz
and here the result -> the file GSF_Multi_Ppanels.ver
VERSION=001
943ec8ec2b2e5e758f9e057f6b50becc  GSF_Multi_Ppanels.tar.gz

I deep analysed your ppanelupdate.sh file and i don't think that i have any trouble with the update procedure.
Give me one day to make my tests with diferents versions of ppanels (or with no /var/etc/xxx.ver file in box just to make a force update), and you will have our Multi PPanel project for your testing purposes.
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #7 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 12 November 2007 - 21:27

Your make_ver.sh is right, I can see you analysed ppanelupdate.sh very well ;)
If you have no .ver file on your box, you will get a forced update. If you don't have a .ver file on your server, you won't get automatic updates (I think, not sure) but manual update will still work.
You can easily check that: remove the .ver file from the server and you will see "Downloading from a non-PLi server" if you do a manual update. If you don't get that message, PPanel found the .ver file on the server.
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Update option in .xml files ??? #8 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 12 November 2007 - 21:37

Your make_ver.sh is right, I can see you analysed ppanelupdate.sh very well ;)


Xexexe no prob with that. Scripting is my favourite stuff in DMs !!!!
Now I am going little deeper with C++ but i have not enough spare time to spent with that language.

By the way I am a little bit currious about the <update> option in .xml files and the relationship with ppanelupdate.sh file. How did you do that ? Just for educational purposes ......
Thanks in advance!!
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #9 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 12 November 2007 - 21:53

By the way I am a little bit currious about the <update> option in .xml files and the relationship with ppanelupdate.sh file. How did you do that ? Just for educational purposes ......
Thanks in advance!!

If PPanel reads the <update> it just starts ppanelupdate.sh with the url in background. If ppanelupdate is finished, PPanel will show a popup ("new menu available..." ) and reloads the PPanel after you've quit it (to prevent that the PPanel changes while you're using it).
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Update option in .xml files ??? #10 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 12 November 2007 - 22:18

All those you describe will happen if /var/etc/ppanelautodownload exists. Am i correct ??
With that trick i assume that when i have set the software menu to be updated automatically, the same situation will occur in my ppanel. When i disable the AU option in my panel, AU will be disabled and in the Software menu panel!! Am I right ???
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #11 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 12 November 2007 - 22:47

All those you describe will happen if /var/etc/ppanelautodownload exists. Am i correct ??

Right!

With that trick i assume that when i have set the software menu to be updated automatically, the same situation will occur in my ppanel. When i disable the AU option in my panel, AU will be disabled and in the Software menu panel!! Am I right ???

Right!
It's a global setting because it was only meant for the Software Management PPanel. So, use it with care in your PPanel as it influences Software Management as well. That's why it is for internal use. Maybe you could use some runBefore and runAfter statements to preserve /var/etc/ppanelautodownload. I should check the PPanel source code to see if it's possible.
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Update option in .xml files ??? #12 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 12 November 2007 - 23:10

Ok @dAF2000. Thank you very very very much for your responses!!!!
I think, with my questions you became dizzy!!!. Enough for tonight !!!!:D

Another set of questions, tommorow!!!! :badgrin:
I' ll be back !!! (Arnold .....) :-D
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #13 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 13 November 2007 - 22:21

[quote=dAF2000][quote=Syrossyn]............Maybe you could use some runBefore and runAfter statements to preserve /var/etc/ppanelautodownload. I should check the PPanel source code to see if it's possible.[/quote]
Yes dAF2000 you are right!! I made my panel to have seperate update option using runBefore and runAfter.
Here is the code .....
[quote]<directory name="My Panel" runBefore="if [ -f /var/etc/mypanelau ];then if [ ! -f /var/etc/ppanelautodownload ];then touch /var/etc/ppanelautodownload;touch /var/etc/convert.enable;fi;else if [ -f /var/etc/ppanelautodownload ];then rm -f /var/etc/ppanelautodownload;touch /var/etc/convert.disable;fi;fi" runAfter="if [ -f /var/etc/convert.enable ];then rm -f /var/etc/ppanelautodownload;rm -f /var/etc/convert.enable;fi;if [ -f /var/etc/convert.disable ];then touch /var/etc/ppanelautodownload;rm -f /var/etc/convert.disable;fi">
<update url="http://myserver/My_panel.tar.gz" target="/"/>
......
......
......
<execute name="Download latest Panel"
condition="[ ! -f /var/etc/mypanelau ]"
target="ppanelupdate.sh http://myserver/My_panel.tar.gz /; rm -f /tmp/ppanelrefresh"
quit="restart"/>
<execute name="Enable Auto Update"
condition="[ ! -f /var/etc/mypanelau ]"
target="touch /var/etc/mypanelau; echo Automatic Update enabled"
quit="restart"/>
<execute name="Disable Auto Update"
condition="[ -f /var/etc/mypanelau ]"
target="rm -f /var/etc/mypanelau; echo Automatic Update disabled"
quit="restart"/>
.....
....
[/quote]

And my question now .....
How many separators can we have in a panel (one sceen at time)??? With 2 i am ok but when i use one more, then enigma stucks!!!
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #14 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 14 November 2007 - 10:02

That a quite long runBefore and runAfter, but it works.
About the separators: there is no limit on that. The backup/restore PPanel has 4 separators for example. Maybe a memory problem?
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Update option in .xml files ??? #15 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 14 November 2007 - 10:52

That a quite long runBefore and runAfter, but it works.

If you have another suggestion, please inform me .....

About the separators: there is no limit on that. The backup/restore PPanel has 4 separators for example. Maybe a memory problem?

In all my ppanels i have the same problem!!! No memory problem i think, as the image is installed in a 2GB usb stick, with swap memory of 32 MB!!!
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #16 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 14 November 2007 - 11:21

Just send me the failing PPanel (by PM) and I'll look at it.
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Update option in .xml files ??? #17 Syrossyn

  • Member
  • 34 posts

0
Neutral

Posted 15 November 2007 - 00:03

@dAF200 as you mentioned above about the memory problem, i really have problem in my DM7020!!!
I thought that i made a swap file in my usb stick, via the Dreambox Settings menu but unfortunatelly no swap file created!!!
I searched in rc.config and there are the following options .....

SWAP_ON=usb
SWAP_SIZE=32

but those options are not readed from any boot script file!!!!
I created the swapfile manually by telnet and first I tried to enable the swap partition via the fstab file but with no success!!
So i edited the misc_services boot script file, to create the swapfile in usb (in case file does not exist) and to enable the swap when booting, with success at this time.
Now i have an extra 32 MB memory space. I tried to run my panel and yes it succeded!!!! Here is 2 snapshots ...

Posted Image

Posted Image

But when i tried to run it for 2nd time, it stucked again!!! Once it's ok, and after it stucks!!!
When i remove the third and fourth <separator> the panel runs all time !!!!

I 'll send you the panel via pm to check it in your box.
Greetings from
GSF Team
Posted Image

Re: Update option in .xml files ??? #18 pepinoogorino

  • Senior Member
  • 65 posts

+2
Neutral

Posted 12 August 2009 - 12:03

Hello!

I use the reference code in my own ppanel:

<directory name="test">
<update url="http://xxx.yyy/zzz.tar.gz" target="/" />
<comment name="test 1" />
<execute name="Download latest menu" condition="[ ! -f /var/etc/ppanelautodownload ]" target="ppanelupdate.sh http://xxx.yyy/zzz.tar.gz /; rm -f /tmp/ppanelrefresh" confirmation="Are you sure to download the latest menu?" quit="restart" helptext="Download the latest PPanel"/>
<execute name="Enable automatic menu downloads" condition="[ ! -f /var/etc/ppanelautodownload ]" target="touch /var/etc/ppanelautodownload; echo Automatic downloads enabled" quit="restart" helptext="Automatically download menus if a new version is available"/>
<execute name="Disable automatic menu downloads" condition="[ -f /var/etc/ppanelautodownload ]" target="rm -f /var/etc/ppanelautodownload; echo Automatic downloads disabled" quit="restart" helptext="Disable the automatic download of menus"/>
</directory>

When I running manualy ppanelupdate.sh everything's looks ok:

root@dm600pvr ~ # ppanelupdate.sh http://xxx.yyy/zzz.tar.gz /
PPanelupdate version 0.12
ppanel.ver		 100% |*****************************|    66	  00:00 ETA
Connecting to xxx.yyy[xxx.xxx.xxx.xxx]:80
Version on Dreambox: 001
Version on server: 002
Connecting to xxx.yyy[xxx.xxx.xxx.xxx]:80
ppanel.tar.gz.tmp    100% |*****************************|   542	  00:00 ETA
Check 1: tarball checksum valid
Check 2: xml files in tarball valid

Menu updated!

but...
When I enable automatic download, ppanel does not show a popup ("new menu avaiable...").
After exit, I run again my ppanel and i see new version ("test 2").
What the hell?

P.S. Sorry for my poor english ;)

Re: Update option in .xml files ??? #19 hemertje

  • Forum Moderator
    PLi® Core member
  • 33,470 posts

+118
Excellent

Posted 12 August 2009 - 12:10

did you create a 'software.ver' file with within that file a versionnumber, for example '1' to start with?

on the Glassfibre 1GB DVB-C...


Re: Update option in .xml files ??? #20 pepinoogorino

  • Senior Member
  • 65 posts

+2
Neutral

Posted 12 August 2009 - 13:39

Yes, of course.

I did create a file zzz.ver (with version and md5sum) on dreambox's side nor from server.
Another thing that is backing up my case is below:

Version on Dreambox: 001
Version on server: 002




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users