#!/bin/sh DIST="${DIST:=$(lsb_release -cs 2>/dev/null)}" case "$DIST" in rpi | jessie | stretch | buster | bullseye) DIST="rpi" KERNEL_RECOMMENDED_VERSION="4.14.39" ;; *) KERNEL_RECOMMENDED_VERSION="6.1.74" ;; esac version_gt() { test "$(printf '%s\n' "$@"| sort -V | head -n 1)" != "$1" } 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." echo Importing Blokas GPG public key... curl -s https://blokas.io/blokas-archive-keyring.gpg | sudo dd status=none of=/usr/share/keyrings/blokas-archive-keyring.gpg echo "Adding Blokas APT ($DIST) repository..." echo "deb [signed-by=/usr/share/keyrings/blokas-archive-keyring.gpg] http://blokas.io/apt/ $DIST main" | sudo dd status=none of=/etc/apt/sources.list.d/blokas.list echo Updating package list... sudo apt-get update 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!