From 2d35945fc41498ddfc22f3e84bf26ff040f598e2 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 6 Nov 2022 11:49:38 -0500 Subject: [PATCH] Add install script --- install.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..d9f8c42f --- /dev/null +++ b/install.sh @@ -0,0 +1,31 @@ +# Installs the roku-youtube.zip app as a dev channel + +if [ -z "$ROKU_DEV_TARGET" ]; +then + echo "Variable ROKU_DEV_TARGET is not set. What is your Roku TV IP address? Example: 192.168.1.2"; + exit -1 +fi + +if [ -z "$DEVPASSWORD" ]; +then + echo "Variable DEVPASSWORD is not set. What is your Roku Dev password? Example: 1234"; + exit -1 +fi + + +tmp_folder=$(mktemp -d) +tmp_zip_file="$tmp_folder/roku-youtube.zip" +tmp_http_response_file="$tmp_folder/roku-response.html" + +echo "Downloading archive to temprary folder ..." + +# TODO: Check for curl, use wget if curl is not available +curl -L https://github.com/iBicha/roku-youtube/releases/latest/download/roku-youtube.zip -o $tmp_zip_file + +echo "Installing app on device at $ROKU_DEV_TARGET ..." + +curl --user rokudev:$DEVPASSWORD --digest --silent --show-error -F "mysubmit=Install" -F "archive=@$tmp_zip_file" --output $tmp_http_response_file --write-out "%{http_code}" http://$ROKU_DEV_TARGET/plugin_install + +echo "Deleting temprary folder ..." + +rm -rf $tmp_folder \ No newline at end of file