Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
manoflinux
Visitor

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.

#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.
0 Kudos
64 REPLIES 64
dynamitemedia
Binge Watcher

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
0 Kudos
manoflinux
Visitor

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.

#/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?
0 Kudos
evilmax17
Visitor

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
0 Kudos
manoflinux
Visitor

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.
0 Kudos
dynamitemedia
Binge Watcher

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.
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
RokuChris
Roku Employee
Roku Employee

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.
0 Kudos
kbenson
Visitor

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!
0 Kudos
manoflinux
Visitor

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.
0 Kudos
manoflinux
Visitor

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.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.