Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: How do I create a plugin?

  1. #1

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts

    Question How do I create a plugin?

    Ok, so I've got a bunch of linux commands that run at a telnet prompt on the vu box. How do i go about converting this into a plugin so I press a button and have it execute?

  2. #2

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts

    How do I create a plugin?

    Sorry for the cross post, I originally posted this in general discussion, but figuered maybe it'd get lost/missed in there and this is probably the better section anyhow.

    Anyway, I've got a bunch of linux commands that run at a telnet prompt on the vu box. How do i go about converting this into a plugin so I press a button and have it execute?
    Or even have it execute on launch/shutdown

  3. #3

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts
    if its just some straight linux commands, could I put them at the end of the /etc/rc.d/init.d/smartd file?

  4. #4
    pooface's Avatar
    Title
    V.I.P
    Join Date
    Jun 2010
    Posts
    9,731
    Thanks
    1,904
    Thanked 4,791 Times in 1,951 Posts
    Moved in to correct location for you...

    As for creating a plugin, you will need to learn python. Have a look at some of the normal plugins, for example the webinfo plugin. You will then need to get the plugin to natively run the commands...

    [Edit]
    OK, just noticed the cross-posting, so have merged the threads...
    Last edited by pooface; 08-11-10 at 10:05.
    Rules can be found HERE
    Support our sponsor, World-Of-Satellite HERE
    Follow us on Twitter HERE
    -----
    Vu+ Ultimo (ViX Beta), Vu+ Solo (ViX Beta), CT ET9000 (ViX Beta)
    Dark Motor Superior with Inverto Ultra Black Twin LNB
    85cm Gibertini Aluminium Dish

  5. The Following User Says Thank You to pooface For This Useful Post:

    nezzeo (08-11-10)

  6. #5

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts
    where are these stored on the box?

  7. #6
    pooface's Avatar
    Title
    V.I.P
    Join Date
    Jun 2010
    Posts
    9,731
    Thanks
    1,904
    Thanked 4,791 Times in 1,951 Posts
    Quote Originally Posted by nezzeo View Post
    where are these stored on the box?
    I think, but typing from memory, so not 100% sure it's correct:

    /usr/lib/enigma2/python/Plugins
    Rules can be found HERE
    Support our sponsor, World-Of-Satellite HERE
    Follow us on Twitter HERE
    -----
    Vu+ Ultimo (ViX Beta), Vu+ Solo (ViX Beta), CT ET9000 (ViX Beta)
    Dark Motor Superior with Inverto Ultra Black Twin LNB
    85cm Gibertini Aluminium Dish

  8. The Following User Says Thank You to pooface For This Useful Post:

    nezzeo (08-11-10)

  9. #7

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts
    ahh ok I see them in /usr/lib/enigma2/python/
    I think learning python for what I want to accomplish might be a bit overkill. If I just wanted to run a couple of linux commands on boot, could I just add them to the smartd ?

  10. #8

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Hmmmm... ok so I've managed to create a .sh script to run the commands, and it executes on bootup.
    My "hello world" style thing of "mkdir /tmp/test" works
    but the moment I try to do a "cd /etc" it fails, presumably on permissions because it can do "cd /tmp" without a problem. Any ideas how to resolve this?

  11. #9
    pooface's Avatar
    Title
    V.I.P
    Join Date
    Jun 2010
    Posts
    9,731
    Thanks
    1,904
    Thanked 4,791 Times in 1,951 Posts
    how about putting your script file in /etc/init.d, chmod it to 755. Then, in telnet, run the following command:

    Code:
    ln -s /etc/init.d/myscriptfile.sh /etc/rc3.d/S99myscript
    Then, restart. Should (I think) make it run on startup...
    Rules can be found HERE
    Support our sponsor, World-Of-Satellite HERE
    Follow us on Twitter HERE
    -----
    Vu+ Ultimo (ViX Beta), Vu+ Solo (ViX Beta), CT ET9000 (ViX Beta)
    Dark Motor Superior with Inverto Ultra Black Twin LNB
    85cm Gibertini Aluminium Dish

  12. The Following User Says Thank You to pooface For This Useful Post:

    nezzeo (08-11-10)

  13. #10

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Here's my script:

    #!/bin/sh
    #DESCRIPTION=test script

    #mkdir /tmp/test
    #cd /tmp/test

    cd /etc/enigma2
    mkdir /etc/enigma2/test
    and when I test run it from telnet I get:

    root@vuduo /etc/init.d # sh testscript.sh
    : not foundh: line 3:
    : not foundh: line 6:
    testscript.sh: cd: line 7: can't cd to /etc/enigma2
    : not foundh: line 9:
    : not foundh: line 12:
    yet the makedir command worked because a directory is created?

  14. #11

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Ah! found my problem, when viewing script in vi on the box, I noticed every line had a ^M (probably windows char return or something)
    Sorted and working, thanks for your help

    When you do a scan, where is the services file stored? Is it just the 1 file or it it multiple?

    FYI What I'm doing is forcing the box pull a list of bouquets from some personal webspace and then copy it to /etc/enigma2
    Last edited by nezzeo; 08-11-10 at 20:56.

  15. #12

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Ok so got that working, only prob now is that once booted it doesnt go to the defautl channel that it was on before it shutdown. I know there's a plugin for auto-channel, but I dont want it to ALWAYS be the same one. Is there a command I can run in linux to force the zap to the last known chan?

    My script is set as S90, so its last in the list of executed before S99rmnologin gets hit, would it help if I put it earlier in the list? say S15 or something?

  16. #13

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Getting there, getting there. I'm taking a slightly different approach now - I'm now trying to do a "Restart Enigma" and have found this:

    Dreamset v2.32

    Fixed: import/compare at west services
    Fixed: Neutrino HD (Coolstream, etc), Reload settings
    Fixed: copy/paste HD services
    Added: Change name/provider of multiple selected services
    Added: Pre-Telnet and post-Telnet commands, now you can restart enigma2 settings with sequence "init 4; sleep 5", "write files", "init 3".
    Added: Setup firmware profiles added "Enigma2 ver 4 (HTTP reload)" and "Enigma2 ver 4 (Telnet reload)"
    the init 4... bit works, except the write returns "-sh: write: not found" - any ideas anyone?
    Last edited by nezzeo; 09-11-10 at 18:12.

  17. #14

    Title
    Senior Member
    Join Date
    Oct 2010
    Location
    Berkshire
    Posts
    9,697
    Thanks
    1,039
    Thanked 4,385 Times in 2,257 Posts
    i dunno if this will work as im pants with this sort of stuff but maybe try this

    #!/bin/sh
    #DESCRIPTION=test script

    #mkdir /var/tmp/test
    #cd /var/tmp/test

    cd /var/etc/enigma2
    mkdir /var/etc/enigma2/test

    thats added the var

    ok igonre this post i was wrong
    PM HELP WILL BE IGNORED PLEASE POST HERE IN FORUM AS IT BENEFITS EVERYONE
    NO CARD SHARING TALK WILL BE TOLERATED, LAN OR WAN! IN OPEN FORUM OR PM


    IF THE POSTS HELP PLEASE CLICK THANKS OR ADD TO REP ↓

  18. The Following User Says Thank You to silverfox0786 For This Useful Post:

    nezzeo (09-11-10)

  19. #15

    Title
    Member
    Join Date
    May 2010
    Posts
    52
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by silverfox0786 View Post
    i dunno if this will work as im pants with this sort of stuff but maybe try this

    #!/bin/sh
    #DESCRIPTION=test script

    #mkdir /var/tmp/test
    #cd /var/tmp/test

    cd /var/etc/enigma2
    mkdir /var/etc/enigma2/test

    thats added the var

    ok igonre this post i was wrong
    I got past this in the end, problem was my script had some funky ^M chars on the end of each line.

    I've finished my script, except for any minor tweaks along the way.
    The script now has evolved into a button thats listed under the plugins. When clicked it downloads my latest bouquets/services from some personal webspace, replaces the current ones, tidies up after itself and reboots the box for the changes to take effect (ideally I'd like it so that it just restarts Enigma instead) but no luck with that so far.

    The reason for this script? I have a couple of friends with boxes, completely non-technical that I dont fancy visiting only to ftp over my latest files every time sky decide to move a chan or 2. Instead they click a button and job done!

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.