From ca3b27f70b3f75ac5a769d535b0dbb8408bd1c29 Mon Sep 17 00:00:00 2001 From: Thorsten Spille Date: Sun, 22 Jan 2023 19:07:16 +0100 Subject: [PATCH] Multiple fixes --- setup-nasbeery | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup-nasbeery b/setup-nasbeery index dd2ec6c..97a520e 100644 --- a/setup-nasbeery +++ b/setup-nasbeery @@ -43,7 +43,7 @@ while getopts "hU:P:H:D:FIZ:S:" opt; do done shift $((OPTIND-1)) -if [[ $(ls nasbeery.conf) ]]; then +if [ -f nasbeery.conf ]; then source nasbeery.conf else cat << EOF > nasbeery.conf @@ -82,6 +82,11 @@ Pin: release a=bullseye-backports Pin-Priority: 900 EOF +grep contrib /etc/apt/sources.list +if [ $? -gt 0 ]; then + sed -i "s/main/main contrib non-free/g" /etc/apt/sources.list +fi + # update system and install packages echo "Updating package lists" apt -qq update @@ -183,7 +188,7 @@ useradd $USERNAME echo "$USERNAME:$PASSWORD" | chpasswd smbpasswd -x $USERNAME (echo $PASSWORD; echo $PASSWORD) | smbpasswd -a $USERNAME -usermod -aG $USERNAME +usermod -aG sudo $USERNAME echo "Writing cockpit configuration" cat << EOF | tee -i /etc/cockpit/zfs/config.json