Multiple fixes

This commit is contained in:
Thorsten Spille 2023-01-22 19:07:16 +01:00
parent 845d135b53
commit ca3b27f70b

View File

@ -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