Jump to content


Photo

user script on green button.


  • Please log in to reply
93 replies to this topic

Re: user script on green button. #21 littlesat

  • PLi® Core member
  • 56,616 posts

+694
Excellent

Posted 5 November 2014 - 19:32

And also shellscripts added...

 

but them to /etc/shellscripts and ensure they have the correct rights (chmod 777) and the extension ends with .sh.... and they are selectable and executable via hotkey...

As output the PPanel script "output generator" is used


Edited by littlesat, 5 November 2014 - 19:33.

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


Re: user script on green button. #22 Erik Slagter

  • PLi® Core member
  • 46,969 posts

+541
Excellent

Posted 5 November 2014 - 20:47

but them to /etc/shellscripts and ensure they have the correct rights (chmod 777) and the extension ends with .sh.... and they are selectable and executable via hotkey...
 
Can we please please please put and end to this for once and for all! Everything runs as root, 755 is really enough!
 
But besides that, I'd prefer the shell script to be run by a shell instead of the kernel, and then the mode can be 644 like default. This prevents random executables to be executed by mistake.

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: user script on green button. #23 littlesat

  • PLi® Core member
  • 56,616 posts

+694
Excellent

Posted 5 November 2014 - 20:51

Indeed.... 777 was to much... but it brings luck (LOL)


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


Re: user script on green button. #24 sjlouis

  • Senior Member
  • 1,538 posts

+3
Neutral

Posted 6 November 2014 - 12:01

Menu - setup - system - hotkey

 

I haven't found it. Is it a very recent version of OpenPli 4.0? I have load the last one in September 2014. That's the menu with "Network", "Hardisk"...?

 

Thank you :) .


Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: user script on green button. #25 WanWizard

  • PLi® Core member
  • 69,121 posts

+1,763
Excellent

Posted 6 November 2014 - 12:01

Yes, it has been introduced in the last few weeks.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: user script on green button. #26 sjlouis

  • Senior Member
  • 1,538 posts

+3
Neutral

Posted 6 November 2014 - 13:21

Ok, thank you. I will do an update soon :) .


Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: user script on green button. #27 sjlouis

  • Senior Member
  • 1,538 posts

+3
Neutral

Posted 7 November 2014 - 10:33

Yes, fantastic :P ! I need something to replace MultiQuickButton which crashed the box with OpenPli4.

 

A few questions :

- Is it possible to have an help to remember the standard use, example : the blue button to call extensions, the yellow for subtitles...

- I haven't see the /etc/shellscripts directory in the box, we have to create it?

- If this directory exists, does Hotkey add an entry in the list : EPG, InfoBar, PPanels, Plugins...?

 

littlesat, is it you who created this product?

 

Thank you :) .


Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: user script on green button. #28 Pike_Bishop

  • Senior Member
  • 1,139 posts

+74
Good

Posted 7 November 2014 - 14:38

Hi littlesat,

 

 

And also shellscripts added...

 

but them to /etc/shellscripts

i'am now a little bit confused

i have my scripts under /usr/script they have all the suffix .sh and the rights are 755

and then i have under /etc/ppanels a my.xml to run my scripts as example it looks as following;

<directory name="My PPanel">
    <execute name="Movies sichtbar/unsichtbar machen" target="sh /usr/script/movie_hide.sh" quit="exit"/>
	<separator/>
    <execute name="Festplatten Temperatur" target="sh /usr/script/hddtemp.sh" quit="exit"/>
	<execute name="Speicherplatz Anzeige" target="sh /usr/script/memory_capacity.sh" quit="exit"/>
	<execute name="Arbeitsspeicher Nutzung" target="cat /proc/meminfo" quit="exit"/>
	<execute name="CPU Info" target="/usr/script/cpuinfo.sh" quit="exit"/>
	<execute name="CPU Auslastung" target="top | head -n 2 | grep CPU:" quit="exit"/>
	<execute name="Module (geladen) anzeigen" target="lsmod" quit="exit"/>
	<execute name="Kernel Version anzeigen " target="uname -a" quit="exit"/>
	<separator/>
	<execute name="EPG reparieren" target="/usr/script/epgdat_replace.sh" quit="exit"/>
	<execute name="NanoXX Aufn zu ts" target="sh /usr/script/nanoxx_to_ts.sh" quit="exit"/>
	<execute name="Dvdbackup2iso Komplett" target="sh /usr/script/dvdbackup_complete.sh" quit="exit"/>
	</directory>

and now i have ppanel with hotkey on button search and this works perfect.

 

therefore i didn't understand what is new now with hotkey, ppanel and /etc/shellscripts?

 

And also shellscripts added...

 

 

regards

Biki3

Attached Files


Receiver: VU Ultimo 4K, Octagon SF8008 4K, Gigablue Quad 4K

Image: OpenPLI-8.3


Re: user script on green button. #29 Pike_Bishop

  • Senior Member
  • 1,139 posts

+74
Good

Posted 7 November 2014 - 14:50

here three pictures as it looks with the method with scripts under /usr/scripts and with a .xml file;

 

 

Attached File  Screenshot-SUPER_RTL9216.jpg   44.02KB   2 downloads Attached File  Screenshot-SUPER_RTL6931.jpg   60.71KB   2 downloads Attached File  Screenshot-SUPER_RTL6835.jpg   63.11KB   2 downloads

 

 

regards

Biki3

 

 


Receiver: VU Ultimo 4K, Octagon SF8008 4K, Gigablue Quad 4K

Image: OpenPLI-8.3


Re: user script on green button. #30 Pike_Bishop

  • Senior Member
  • 1,139 posts

+74
Good

Posted 7 November 2014 - 15:39

Hi littlesat,

 

ok i have testet it (for @sjlouis the directory /etc/shellscripts you must create manually)

and now i understand it's to run scripts directly with one button and without a own .xml - that's a fine thing  :)  thanks a lot @littlesat

 

Attached File  one.jpg   46.04KB   3 downloads Attached File  two.jpg   69.64KB   3 downloads Attached File  three.jpg   72.86KB   3 downloads

 

regards

Biki3


Edited by Biki3, 7 November 2014 - 15:40.

Receiver: VU Ultimo 4K, Octagon SF8008 4K, Gigablue Quad 4K

Image: OpenPLI-8.3


Re: user script on green button. #31 littlesat

  • PLi® Core member
  • 56,616 posts

+694
Excellent

Posted 7 November 2014 - 16:34

Shall i change the scripts directory to /usr/scripts?

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


Re: user script on green button. #32 sjlouis

  • Senior Member
  • 1,538 posts

+3
Neutral

Posted 7 November 2014 - 17:13

It works fine! Thank you Biki3 and thank you very much littlesat. All what I want in the same product :lol: .

 

No matter for the directory. Do what you want ;) .

 

Some questions : when I press the key, there is a window with my script and : << and >> at the bottom. I pressed "Ok" because I don't know what tot do and nothing seems to be done. As it was to do my backup, I go on the backup hard disk and I could see the files are backuped. Is there a possibility to verify the progression? For example when we use manual upload EPG, we can exit from the window but the job continue and when we open it again, we can see the progression :) .

 

Now I don't know if the script has finished and when I can remove the backup disk.

 

Thank you :) .


Edited by sjlouis, 7 November 2014 - 17:16.

Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: user script on green button. #33 Pike_Bishop

  • Senior Member
  • 1,139 posts

+74
Good

Posted 7 November 2014 - 17:47

Hi littlesat,

 

 

Shall i change the scripts directory to /usr/scripts?

 

ppanel needs his scripts under /usr/script not in /usr/scripts - sorry was my error i know :)

but for me it's ok as it is with /etc/shellscripts - i have made a symlink with;

ln -s /usr/script /etc/shellscripts

@sjlouis

 

Now I don't know if the script has finished and when I can remove the backup disk.

 

You can build in logging with a ready message in your script and then you can with Plugin DreamExplorer have a look in your LogFile as it is ready

or;

you can give your script a message with wget that you can see on your osd as example;

wget "http://XXX.XXX.XXX.XX/web/message?text=Starte%20DVD%20kopieren%20...%20->%20$STARTDATE&type=1&timeout=15"

but you must replace the XXX.XXX.XXX.XX in the code with your real box IP

you can test this command with telnet also.

 

and you can use logging and wget messages both in your script - that's the best way i think.

 

 

regards

Biki3


Edited by Biki3, 7 November 2014 - 17:51.

Receiver: VU Ultimo 4K, Octagon SF8008 4K, Gigablue Quad 4K

Image: OpenPLI-8.3


Re: user script on green button. #34 ims

  • PLi® Core member
  • 13,648 posts

+213
Excellent

Posted 7 November 2014 - 17:58

<< and >>  ... when output is wider than screen


Kdo nic nedělá, nic nezkazí!

Re: user script on green button. #35 sjlouis

  • Senior Member
  • 1,538 posts

+3
Neutral

Posted 7 November 2014 - 18:19

Ok, Biki3, I will try it but can you give me some explanations?

 

Is the osd is the screen? Can I read it on the screen of my TV? I was a little surprised with your command. There is "text" in the command and I think I can write : "OK, backup has finished" but there a lot of strange symbols. Thus I've searched informations about wget on Internet and I've only found wget is used to download files. I'm lost :unsure: .

 

ims, what do you want to say for the output? When I press "Ok", the windows disappears (is it normal?), thus I can't see nothing in the windows.

 

Thank you :) .


Edited by sjlouis, 7 November 2014 - 18:23.

Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: user script on green button. #36 Pike_Bishop

  • Senior Member
  • 1,139 posts

+74
Good

Posted 7 November 2014 - 18:50

Hi,

 

 

Ok, Biki3, I will try it but can you give me some explanations?

 

ok i will make for you a short example script - then you see clear i think.

 

regards

Biki3


Receiver: VU Ultimo 4K, Octagon SF8008 4K, Gigablue Quad 4K

Image: OpenPLI-8.3


Re: user script on green button. #37 Pike_Bishop

  • Senior Member
  • 1,139 posts

+74
Good

Posted 7 November 2014 - 19:38

Hi sjlouis,

 

here now a example script it looks as following;

#!/bin/sh

## variables ##
INET_INTERFACE="eth0"
WGET=/usr/bin/wget
TMP=/tmp
LOGFILE=$TMP/test.log
MESSAGES="*timeout=15"


# the job starts
# general logging
exec >$LOGFILE; exec 2>&1


# read out IP of your box for messages with wget
BOXIP="$(ifconfig "$INET_INTERFACE" | head -n 2 | tail -n 1 | cut -d: -f2 | cut -d" " -f 1)"
echo -e "\nIP of your Box -> $BOXIP\n"
BOXIP="$(echo http://$BOXIP)"


# change to the directory /tmp or as variable $TMP
cd $TMP


# remove the files of the old wget messages, otherwise you didn't got messages if you run the script again
rm -f $MESSAGES


# job starttime and message on the osd from your tv
STARTDATE="$(date +%a:%b:%Y:%H:%M)" && echo -e "\nJOB START -> $STARTDATE\n"
$WGET "$BOXIP/web/message?text=backup%20is%20starting%20->%20$STARTDATE&type=1&timeout=15"


# make a directory with name testdir in $TMP
mkdir testdir

# query if creating directory is successful or not (if it's not successful then the command after else grips)
if [ "$?" = "0" ] ; then
	echo "directory testdir created in $TMP:"
	echo -e "\nOK backup has finished\n"
else
	echo "sorry job failed, cannot create directory testdir in $TMP:"
fi


# a wait from 10 seconds	
sleep 10

	
# job is ready and message thereto on the osd from your tv
ENDDATE="$(date +%a:%b:%Y:%H:%M)" && echo -e "\nJOB ENDE -> $ENDDATE\n"
$WGET "$BOXIP/web/message?text=OK%20backup%20has%20finished%20!!!%20->%20$ENDDATE&type=1&timeout=15"


exit

name it test.sh, put it to /etc/shellscripts and make it with the following command in telnet executable;

 chmod 755 /etc/shellscripts/test.sh

then put it to a button for hotkey and test it.

it makes only a directory with name testdir in /tmp but you can see messages on the osd from your tv if your box is online with eth0

and you have then a logfile in /tmp with name test.log

 

 

regards

Biki3


Edited by Biki3, 7 November 2014 - 19:43.

Receiver: VU Ultimo 4K, Octagon SF8008 4K, Gigablue Quad 4K

Image: OpenPLI-8.3


Re: user script on green button. #38 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 7 November 2014 - 19:57


wget "http://XXX.XXX.XXX.XX/web/message?text=Starte%20DVD%20kopieren%20...%20->%20$STARTDATE&type=1&timeout=15"

 

As biki3 said you have to exchange the XXX.XXX.XXX.XX with your box ip.

Perhaps the %20 and so on is confusing.

 

A very simple example is this:

wget "http://XXX.XXX.XXX.XX/web/message?text=TEST&type=1&timeout=15"

In this case TEST is shown on the screen for 15 seconds. If you want to use spaces to need to use %20 instead, because a URL cannot have spaces.

If you add $STARTDATE to the text then the date is shown on the screen.


Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: user script on green button. #39 sjlouis

  • Senior Member
  • 1,538 posts

+3
Neutral

Posted 7 November 2014 - 20:45

Waouaw, thank you Biki3 but it's a little complex :unsure: . I'm lost. I will examine it tomorrow.

 

betacentauri, ok it's easier to understand.

 

Can you explain what is the utility of : type = 1?

 

Thank you Biki3 and betacentauri :) .


Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: user script on green button. #40 Pike_Bishop

  • Senior Member
  • 1,139 posts

+74
Good

Posted 7 November 2014 - 20:56

Hi betacentauri,

 

yes you're right it's a little bit confusing :).

 

 

As biki3 said you have to exchange the XXX.XXX.XXX.XX with your box ip.

yes, except he build it in as he can see at my testscript in my last post then he didn't need it because the script read out the IP.

 

 

@sjlouis

if you test the script test.sh as you can see in my last post and you see the first message on osd as following;

Attached File  Screenshot-ProSieben9016.jpg   33.45KB   2 downloads

then it's best you promptly close the osd with exit button until you can see only the live-tv picture then you'll see the end message comes from alone

(you must only wait a little bit).

 

 

regards

Biki3


Edited by Biki3, 7 November 2014 - 20:58.

Receiver: VU Ultimo 4K, Octagon SF8008 4K, Gigablue Quad 4K

Image: OpenPLI-8.3



2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users