#!/bin/sh DIST="${DIST:=$(lsb_release -cs 2>/dev/null)}" LEGACY=false case "$DIST" in rpi | jessie | stretch | buster) echo "Your OS is based on a no longer supported Debian version, codenamed '$DIST'. Please upgrade your OS image." exit 1 ;; bullseye) DIST="rpi" LEGACY=true ;; bookworm) LEGACY=true ;; esac version_gt() { test "$(printf '%s\n' "$@"| sort -V | head -n 1)" != "$1" } KERNEL_RECOMMENDED_VERSION=6.1.64 KERNEL_CURRENT_VERSION=$(uname -r) echo -n "Checking if the kernel version is $KERNEL_RECOMMENDED_VERSION or newer... " if version_gt $KERNEL_RECOMMENDED_VERSION $KERNEL_CURRENT_VERSION; then echo "It's not." echo echo "Your Linux kernel version ($KERNEL_CURRENT_VERSION) is below the recommended kernel version ($KERNEL_RECOMMENDED_VERSION)!" echo "Please upgrade it first by running the below command and following on screen instructions, and run Pisound install again!" echo echo "sudo rpi-update" exit 1 fi echo "It is." if ! ${LEGACY}; then echo "Importing Blokas GPG RSA4096 public key..." curl -s https://blokas.io/blokas-archive-keyring-rsa4096.gpg | sudo dd status=none of=/etc/apt/keyrings/blokas-archive-keyring-rsa4096.gpg echo "Adding Blokas APT $DIST repository..." cat << EOF | sudo dd status=none of=/etc/apt/sources.list.d/blokas.sources Types: deb URIs: http://apt.blokas.io/ Suites: $DIST Components: main Signed-By: /etc/apt/keyrings/blokas-archive-keyring-rsa4096.gpg EOF echo "Updating package list..." sudo apt-get update else echo "Importing Blokas GPG public key..." sudo mkdir -p /etc/apt/keyrings curl -s https://blokas.io/blokas-archive-keyring.gpg | sudo dd status=none of=/etc/apt/keyrings/blokas-archive-keyring.gpg echo "Adding Blokas APT $DIST repository..." echo "deb [signed-by=/etc/apt/keyrings/blokas-archive-keyring.gpg] http://apt.blokas.io/ $DIST main" | sudo dd status=none of=/etc/apt/sources.list.d/blokas.list echo "Updating package list..." sudo apt-get update fi echo Installing Pisound software... sudo apt-get -y install pisound echo Updating /usr/local/pisound... sudo sh -c 'cd /usr/local/pisound && git -c user.name="blokas_installer" -c user.email="blokas@installer" stash && git -c user.name="blokas_installer" -c user.email="blokas@installer" pull --no-rebase' echo echo Now you may run \'sudo pisound-config\' to customize your installation! # If you see this output, rerun the curl command with "| sh" at the end. Entire command: # # curl https://blokas.io/pisound/install.sh | sh