#!/bin/sh
set -e


# Remove old .sources files
for f in \
	/etc/apt/sources.list.d/home:guideos:universe.sources \
	/etc/apt/sources.list.d/home:guideos:trixie.sources \
	/etc/apt/sources.list.d/home:guideos:cinnamon-trixie.sources
do
	if [ -e "$f" ]; then
		echo "Entferne $f ..."
		rm -f "$f"
	fi
done



# Set Apt::Install-Recommends to false
echo "Set Apt::Install-Recommends to false in /etc/apt/apt.conf.d/99norecommends ..."
echo 'Apt::Install-Recommends "false";' > /etc/apt/apt.conf.d/99norecommends

# Remove all files and directories from /etc/skel/
if [ -d "/etc/skel" ]; then
	echo "Removing contents of /etc/skel/..."
	rm -rf /etc/skel/*
	rm -rf /etc/skel/.[!.]* /etc/skel/..?*
fi

# Download and install skel-0.9.1.5
cd /tmp
wget https://github.com/GuideOS/skel/archive/refs/tags/0.9.1.5.tar.gz
tar -xf 0.9.1.5.tar.gz
mv /tmp/skel-0.9.1.5/etc/skel /etc/
rm -rf /tmp/skel-0.9.1.5
rm -rf /tmp/0.9.1.5.tar.gz

wget https://raw.githubusercontent.com/GuideOS/guideos-live-config/refs/heads/main/config/includes.chroot/etc/default/grub-btrfs/config -O /etc/default/grub-btrfs/config

exit 0
