manoflinux
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2011
12:26 AM
bash scripts to upload and delete from the roku menu
I know there are better ways to do this, but I thought someone might find this useful.
NOTE: it will upload a file even if there is no initial file there. I know the form is different if you don't have a file. but the roku doesn't care as long as my http post is correct.
#parameters filename then ipaddress of roku ie uproku simplevideoplayer.zip 192.168.2.23
uproku ()
{
uagent='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
curl --silent --show-error --user-agent "$uagent" --form archive=@$1 --form "mysubmit=Replace" "http://$2/plugin_install" |grep "Application Received:"|tr '>' '\n'|tail -n 1 ;
echo "size on disk is $(ls -alb $1 |awk '{ print $5 }') bytes ";
}
#all it needs is the ip address. ie delroku 192.168.2.23
#deltron when is the next album
delroku ()
{
uagent='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
curl --silent --show-error --user-agent "$uagent" --form "archive=" --form 'mysubmit=Delete' "http://$1/plugin_install" |grep Delete|tr '>' '\n'|tail -n 1 ;
}
NOTE: it will upload a file even if there is no initial file there. I know the form is different if you don't have a file. but the roku doesn't care as long as my http post is correct.
64 REPLIES 64
dynamitemedia
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2011
11:57 AM
Re: bash scripts to upload and delete from the roku menu
Can you explain what this is for?
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
manoflinux
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011
12:23 AM
Re: bash scripts to upload and delete from the roku menu
If you make your own private channels, these scripts will allow you to upload your channel from the linux command line or delete the channel from the command line. I saw something about modifying your make file, but this seems cleaner, especially if you have multiple roku's
I am working towards a kate script to use make to "make" the roku zip package.
and then use uproku to upload the zip file to my roku automatically.
Kate is a KDE text editor I use for modifying brightscript. hopefully they will add brightscript highlighting soon.
Eventually I will implement all the functions of the dev menu as shell scripts for completeness.
These are bash functions, either you can cut and paste them into your current shell or place them in your bashrc.
or you can make a file called uproku and populate it with text below.
in the example above you will notice that the function has the same name as the filename of the script. this works because the function will get executed before the local file(except the first time you run the file when the function is not defined yet)..
Does that explain the purpose?
I am working towards a kate script to use make to "make" the roku zip package.
and then use uproku to upload the zip file to my roku automatically.
Kate is a KDE text editor I use for modifying brightscript. hopefully they will add brightscript highlighting soon.
Eventually I will implement all the functions of the dev menu as shell scripts for completeness.
These are bash functions, either you can cut and paste them into your current shell or place them in your bashrc.
or you can make a file called uproku and populate it with text below.
#/bin/bash
uproku ()
{
uagent='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
curl --silent --show-error --user-agent "$uagent" --form archive=@$1 --form "mysubmit=Replace" "http://$2/plugin_install" |grep "Application Received:"|tr '>' '\n'|tail -n 1 ;
echo "size on disk is $(ls -alb $1 |awk '{ print $5 }') bytes ";
}
uproku "$1" "$2";
in the example above you will notice that the function has the same name as the filename of the script. this works because the function will get executed before the local file(except the first time you run the file when the function is not defined yet)..
Does that explain the purpose?
evilmax17
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011
06:32 AM
Re: bash scripts to upload and delete from the roku menu
Just a tip, but Code tags make things much more readable (and they preserve indentation).
Like this.
My Roku Channels:
Viddler - viddler.com
Tested Fan - tested.com | Jamie & Adam
This is my next - theverge.com
1080p Showcase - RIP
Whiskey Media - RIP
======================
http://www.binarymoustache.com
Viddler - viddler.com
Tested Fan - tested.com | Jamie & Adam
This is my next - theverge.com
1080p Showcase - RIP
Whiskey Media - RIP
======================
http://www.binarymoustache.com
manoflinux
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011
07:55 AM
Re: bash scripts to upload and delete from the roku menu
"evilmax17" wrote:
Just a tip, but Code tags make things much more readable (and they preserve indentation).Like this.
done and did my other posts. it does make it more readable.
dynamitemedia
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011
09:30 AM
Re: bash scripts to upload and delete from the roku menu
I do not use linux but in windows and i believe in mac, the page roku already has set up for us is quite simple as clicking a button.
Not sure what makes this any simpler than that, but i do not have a Linux to see what the Linux page looks like from Roku.
Maybe will be helpful to someone and i am sure they appreciate your sharing.
Not sure what makes this any simpler than that, but i do not have a Linux to see what the Linux page looks like from Roku.
Maybe will be helpful to someone and i am sure they appreciate your sharing.
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011
09:41 AM
Re: bash scripts to upload and delete from the roku menu
The Makefiles in the SDK are also great tools for automating the build process, IMO. They make zipping, sideloading, and packaging tasks much more efficient.
kbenson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011
10:16 AM
Re: bash scripts to upload and delete from the roku menu
"RokuChris" wrote:
The Makefiles in the SDK are also great tools for automating the build process, IMO. They make zipping, sideloading, and packaging tasks much more efficient.
Indeed. The makefile setup included in the examples makes uploading as simple as:
ROKU_DEV_TARGET=10.11.12.13 make install
from the target channel's source dir. All it takes is a change of the ROKU_DEV_TARGET address supplied to target a different system. Additionally, special directives can be put in each individual apps' Makefile, such as to pre-process files in some manner. We've seriously considered writing our own macro pre-processor to get around some limitations (such as inlining some common functions to ease programming and reduce function call overhead). This becomes much more important in 3.0...
-- GandK Labs
Check out Reversi! in the channel store!
Check out Reversi! in the channel store!
manoflinux
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011
12:00 PM
Re: bash scripts to upload and delete from the roku menu
"dynamitemedia" wrote:
I do not use linux but in windows and i believe in mac, the page roku already has set up for us is quite simple as clicking a button.
Not sure what makes this any simpler than that, but i do not have a Linux to see what the Linux page looks like from Roku.
Maybe will be helpful to someone and i am sure they appreciate your sharing.
If you dont understand the difference between a web and command line interface and why you would need both, I cant help you.
manoflinux
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011
12:01 PM
Re: bash scripts to upload and delete from the roku menu
"kbenson" wrote:"RokuChris" wrote:
The Makefiles in the SDK are also great tools for automating the build process, IMO. They make zipping, sideloading, and packaging tasks much more efficient.
Indeed. The makefile setup included in the examples makes uploading as simple as:
ROKU_DEV_TARGET=10.11.12.13 make install
from the target channel's source dir. All it takes is a change of the ROKU_DEV_TARGET address supplied to target a different system. Additionally, special directives can be put in each individual apps' Makefile, such as to pre-process files in some manner. We've seriously considered writing our own macro pre-processor to get around some limitations (such as inlining some common functions to ease programming and reduce function call overhead). This becomes much more important in 3.0...
ok I have two roku's I want to test on. so I have to make two make files? my way seems easier.