TiVoCommunity.com
(c)opyright 1995-2005 All rights reserved
indexcheckTC
This area is a static history of posts in the TiVo Community Forum Archive.
This archive history was made for the simple indexing of search sites like
Google.
Pages:1
Here's a Tivoweb module to do CGI-like stuff
(Click here to view the original thread with full colors/images)
Posted by: cojonesdetoro
--------------------------------------------------------------------------------
This is a simple tivoweb module that will execute a bash script and pass parameters to it. I was looking for a way to do cgi on tivoweb and came up with this. Included are sample scripts on how to use it for things like: starting tivoftpd, starting telnet, rebooting tivo and almost anything else you can do from the command line. The bash script I have included shows an HTML menu but it could be anything you want it to be.
This archive has the script.itcl module file and two example scripts. All you need to do is unzip and extract the included tar file in your modules directory. You can then edit the script.sh file to suite your needs. It's a nice easy way for us non-TCL programmers to add functions to tivoweb without begging or having to learning TCL. You can also make changes to the script without having to reload tivoweb.
NOTE: I have not tested this extensively although it does work on my Philips SA1/3.0 w/ Tivoweb 1.9.4B4. I have not tried it with any other software combination so YMMV. As always, caveat emptor.
EDIT:
some simple instructions:
There are three files:
script.itcl
script.sh
script.sh-bare
copy all three to the tivweb modules directory. I've assumed that it's /var/hack/tivoweb-tcl/modules so edit stuff if your's is different.
Script.itcl is the module itself . Remember to restart Tivoweb.
script.sh is the bash script that is actually executed by the module. You can pass parameters to it via the module to make it do different things. I had mine display a clickable html menu. This one is an example of what can be done.
script.sh-bare is just like the one above but is set up with generic options. This is probably the one you want to edit and make it do the stuff you want it to do.
Unless you'ved editted the module, it will always run the script called 'script.sh' that is contained in the modules directory. There's an easy to find line where you can change the script path.
You may need to do a chmod 755 to each file.
EDIT: seems to work with TivowebPlus as well
Posted by: Appleman
There doesn't appear to be any attachment.
Posted by: cojonesdetoro
<slap to the forehead>
DOH!
</slap to the forehead>
Here is it.
Posted by: PortlandPaw
Nice work! I just stumbled across your app and I think it might come in handy. One suggestion -- I had to re-save the text files in UNIX (not DOS) format to get them to run. But once I did that, it went slick as a whistle. I think I might have fun with this.
Thanks for the contribution!
Posted by: cojonesdetoro
quote:
Originally posted by PortlandPaw
Thanks for the contribution!
I'm just happy I can contribute something. It's actually dirt simple if you look at the code. There's already an improvement on the 'other' site. Some dude added an input field so you can directly run bash commands. Pretty handy if you need to issue a command you didn't think of 'hardwiring' as a callable script beforehand (restart telnet, etc).
Also, a word of warning. A script called by this module that does not return control to the parent process will lock up all of Tivoweb unless you manually kill the script process from bash.
I posted a link to an Expect script on DDB that enforces timeouts on child processes. You also have to use it with care because we know what happens to the Tivo when certain process are rudely killed.
vBulletin Copyright ©2000 - 2009,
Jelsoft Enterprises Limited.
vB Easy Archive Final ©2000 - 2009
- Created by Stefan "Xenon" Kaeser
Modified by Adam J. de Jaray