Jump to content


Photo

Can PPanels process variables


  • Please log in to reply
8 replies to this topic

#1 jimux

  • Member
  • 33 posts

+1
Neutral

Posted 25 November 2011 - 08:22

I am attempting to create a PPanel which uses expressions to create values which are then used later as command line parameters of a shell script. It appears that PPanels cannot create or use environment variables. Is there a way round this?

<execute name="What Size disk can we make"
condition="[ -e /media/inside-disk ] &amp;&amp; [ -e /media/inside-disk/Allsats/SataSetup_pp.sh ] &amp;&amp; [ ! -e /media/BigLoop ] "
runBeforeOut="export FreeSpace=$(df | grep inside | awk '{print $4}');
echo 'you currently have ' $FreeSpace 'available for logical disk' "
target="let 'FreeGb = FreeSpace / 1024000';
let 'SafeSize = FreeSpace /1250000';
echo -e 'FreeSpace is ' $FreeGb 'Gb and recommended disk size is ' $SafeSize 'Gb';
echo -e 'command would be\n\t ./SataSetup_pp.sh Loopy $SafeSize'"
helptext="Calculate maximum logical disk size based on current free space"/>


Technomate box user (TM9100, TM800HD) and moderator on allsats.co.uk Linux/unix fan for many years.

Re: Can PPanels process variables #2 hemertje

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

+118
Excellent

Posted 25 November 2011 - 11:50

PPanels are never intented to work at E2 boxes.
they are only in E2 for minimal support when we made the switch from E1 to E2.

on the Glassfibre 1GB DVB-C...


Re: Can PPanels process variables #3 pepinoogorino

  • Senior Member
  • 65 posts

+2
Neutral

Posted 25 November 2011 - 13:11

Maybe someone would write something similar to the sample-ppanel in python?

Re: Can PPanels process variables #4 hemertje

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

+118
Excellent

Posted 25 November 2011 - 13:23

don't count on us...

on the Glassfibre 1GB DVB-C...


Re: Can PPanels process variables #5 littlesat

  • PLi® Core member
  • 56,318 posts

+691
Excellent

Posted 25 November 2011 - 13:36

In E2 it is more flexible to add python code i.s.o. ppanels....

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Can PPanels process variables #6 pepinoogorino

  • Senior Member
  • 65 posts

+2
Neutral

Posted 25 November 2011 - 14:08

@littlesat
Yeah I know, but just missing a good example :)

Re: Can PPanels process variables #7 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 28 November 2011 - 09:58

If you really want to use a PPanel, you could write the values to a file in /tmp and read them again from your script. I can't program Python either.
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Can PPanels process variables #8 jimux

  • Member
  • 33 posts

+1
Neutral

Posted 29 November 2011 - 12:44

Thank you for all replies.
Yes I do already have to write out to file but I think there is a missed opportunity for more elegant code, as well as an inefficient use of cpu and memory resources.
Technomate box user (TM9100, TM800HD) and moderator on allsats.co.uk Linux/unix fan for many years.

Re: Can PPanels process variables #9 digidude

  • Senior Member
  • 136 posts

+10
Neutral

Posted 29 November 2011 - 20:56

you can write a simple python script to run a bash script without needing to use ppanels, if you already have the script that the ppanel runs, then a very basic python script can run this, and also have some fancy graphics added to it to create a full blown plugin, this has the added benefit of the console output running in real time, instead of filling the screen upon completion of the script with the entire output all at once,

you can even use an xml within the python script to call everything so its the same as working with a ppanel from the 'building' side of things, i recoded an entire ppanel like this, and the user interface is now much better for it

if you want any advise on what i did to achieve this, you know where i am m8 :)

DMM 2x 500s, 2x 7020Si, 600s, 800s, 500HD.


Technomate 500, 500Super, 600, 9100, 800HD, 500HD, TWIN-OE, 2T-OE, Single-OE, NANO-OE. (& all non linux)


Vu+ Duo and others :)

ALL originals, a clone free environment.

 

www.technomatesoftware.co.uk



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users