Forum Discussion

manoflinux's avatar
manoflinux
Visitor
15 years ago

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.

63 Replies

  • Locked because people aren't getting the hint.

    Take it to Private Messages.

    C. Shawn Smith
  • #LIVE CUST SUPT!#Live customer support is the obvious solution but you are not seeking a solution. Chaos and frustration is your goal.

    • VinFem's avatar
      VinFem
      Newbie

      I I don't want to be an an expert. I want to be able to use the equipment.

      Easily without confusion. I don't want things added to my bill without my consent o'knolknowledge. I don't want free trials that turn into page subscriptions without my knowledge or  consent..