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?
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?
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
if its just some straight linux commands, could I put them at the end of the /etc/rc.d/init.d/smartd file?
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...
nezzeo (08-11-10)
where are these stored on the box?
nezzeo (08-11-10)
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 ?
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?
how about putting your script file in /etc/init.d, chmod it to 755. Then, in telnet, run the following command:
Then, restart. Should (I think) make it run on startup...Code:ln -s /etc/init.d/myscriptfile.sh /etc/rc3.d/S99myscript
nezzeo (08-11-10)
Here's my script:
and when I test run it from telnet I get:#!/bin/sh
#DESCRIPTION=test script
#mkdir /tmp/test
#cd /tmp/test
cd /etc/enigma2
mkdir /etc/enigma2/test
yet the makedir command worked because a directory is created?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:
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.
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?
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:
the init 4... bit works, except the write returns "-sh: write: not found" - any ideas anyone?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)"
Last edited by nezzeo; 09-11-10 at 18:12.
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 ↓
nezzeo (09-11-10)
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!