manoflinux
15 years agoVisitor
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.