Skip to content

Instantly share code, notes, and snippets.

@tonioriol
Last active June 3, 2023 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonioriol/09fb5df43abbcd7be844e05ce4f13d88 to your computer and use it in GitHub Desktop.
Save tonioriol/09fb5df43abbcd7be844e05ce4f13d88 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Exit if any command fails
set -e
# Check if script is run as root
if [ "$EUID" -eq 0 ]
then echo "Please do not run as root"
exit
fi
# Get Debian version and architecture
debian_version=$(lsb_release -cs)
architecture=$(dpkg --print-architecture)
# Get the latest release tag from GitHub API
echo "Fetching the latest Stremio release..."
latest_release=$(curl --silent "https://api.github.com/repos/shivasiddharth/Stremio-RaspberryPi/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
# Determine the appropriate Stremio binary to download based on architecture
if [ "$architecture" = "arm64" ]
then
stremio_binary="Stremio-$latest_release-arm64-64-bit.zip"
libfdk="libfdk-aac1_0.1.6-1_arm64.deb"
stremio_package="stremio_$latest_release-1_arm64.deb"
stremio_dir="Stremio-$latest_release-arm64-64-bit"
elif [ "$architecture" = "armhf" ]
then
stremio_binary="Stremio-$latest_release-armhf-32-bit.zip"
libfdk="libfdk-aac1_0.1.6-1_armhf.deb"
stremio_package="stremio_$latest_release-1_armhf.deb"
stremio_dir="Stremio-$latest_release-armhf-32-bit"
else
echo "Unsupported architecture: $architecture"
exit 1
fi
# Download the Stremio binary zip file
echo "Downloading Stremio binary..."
wget https://github.com/shivasiddharth/Stremio-RaspberryPi/releases/download/$latest_release/$stremio_binary
# Unzip the downloaded file
echo "Unzipping the downloaded file..."
unzip -o $stremio_binary
# Add Debian sources
echo "Adding Debian sources..."
echo "deb http://ftp.us.debian.org/debian/ $debian_version main contrib non-free" | sudo tee -a /etc/apt/sources.list
echo "deb http://deb.debian.org/debian $debian_version main contrib non-free" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
# Change directory
echo "Changing directory to $stremio_dir..."
cd $stremio_dir
# Install the Stremio package
echo "Installing Stremio..."
sudo dpkg -i ./$libfdk ./$stremio_package
echo "Stremio installation completed successfully. Enjoy!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment