From c0d8960b67659395fb84e41c5c2b691b014acc10 Mon Sep 17 00:00:00 2001 From: "thorsten.spille" Date: Wed, 7 Jun 2023 00:04:34 +0200 Subject: [PATCH] Add support for Debian bookworm --- setup-nasbeery | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/setup-nasbeery b/setup-nasbeery index 0cdd17f..5dde677 100644 --- a/setup-nasbeery +++ b/setup-nasbeery @@ -18,6 +18,20 @@ usage() { exit $1 } +if [ -f /etc/os-release ]; then + source /etc/os-release +else + echo "File /etc/os-release not found. Please refer to the documentation if your distro is supported." + exit 1 +fi + +if [[ ${VERSION_CODENAME} == "bullseye" ]] || [[ ${VERSION_CODENAME} == "bookworm" ]]; then + echo "Your distro $ID ${VERSION_CODENAME} is supported." +else + echo "Your distro $ID ${VERSION_CODENAME} is not supported." + exit 1 +fi + USERNAME=nasbeery HOSTNAME=nasbeery DOMAIN=bashclub.lan @@ -72,7 +86,7 @@ FORMAT=$? echo "Configure apt to install cockpit from backports repo" cat << EOF | tee -i /etc/apt/preferences.d/99-cockpit Package: cockpit cockpit-* -Pin: release a=bullseye-backports +Pin: release a=${VERSION_CODENAME}-backports Pin-Priority: 900 EOF @@ -81,8 +95,8 @@ if [ $? -gt 0 ]; then sed -i "s/main/main contrib non-free/g" /etc/apt/sources.list fi -echo "Add debian bullseye backports repo" -echo "deb http://ftp.de.debian.org/debian/ bullseye-backports main contrib non-free" | tee -i /etc/apt/sources.list.d/bulleye-backports.list +echo "Add debian ${VERSION_CODENAME} backports repo" +echo "deb http://ftp.de.debian.org/debian/ ${VERSION_CODENAME}-backports main contrib non-free" | tee -i /etc/apt/sources.list.d/bulleye-backports.list # update system and install packages echo "Updating package lists" @@ -123,7 +137,7 @@ echo "deb [signed-by=/etc/apt/trusted.gpg.d/45drives.gpg arch=amd64] https://rep echo "Updating package lists" apt -qq update echo "Installing samba" -DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt -y -qq -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" install -t bullseye-backports acl samba-dsdb-modules samba-vfs-modules samba winbind wsdd zfs-dkms zfsutils-linux zfs-auto-snapshot +DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt -y -qq -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" install -t ${VERSION_CODENAME}-backports acl samba-dsdb-modules samba-vfs-modules samba winbind wsdd zfs-dkms zfsutils-linux zfs-auto-snapshot if [[ "$(arch)" == "aarch64" ]]; then znapzend_version=$(apt search znapzend 2>/dev/null | grep znapzend | cut -d ' ' -f2)