initial commit

This commit is contained in:
Aaron Murray 2023-12-13 06:42:38 -06:00
parent 15bf277791
commit ec21ada3fb

63
fix6to7upgrade Executable file
View File

@ -0,0 +1,63 @@
#!/bin/bash
#
# shellcheck disable=SC1090,SC1091,SC1117,SC2016,SC2046,SC2086
#
# version: 0.0.1
#
if [[ $(id -u) -ne 0 ]]; then
echo "This script must be executed as root or using sudo."
exit 99
fi
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
export LANG=C.UTF-8
echo "Removing old sources ..."
rm -f /etc/apt/sources.list.d/omvextras.list /etc/apt/sources.list.d/omv-extras-org.list
echo "Clearing cache ..."
/usr/bin/salt-call --local saltutil.clear_cache
omv-salt stage run prepare
echo "Rebuilding sources.list* ..."
omv-salt deploy run apt omvextras
echo "Change to bullseye and shaitan just in case ..."
sed -i "s/bullseye/bookworm/g" /etc/apt/sources.list
sed -i "s/bullseye/bookworm/g" /etc/apt/sources.list.d/*
sed -i "s/shaitan/sandworm/g" /etc/apt/sources.list.d/*
if [ -f /etc/apt/apt.conf ]; then
echo "Changing apt.conf ..."
sed -i "s/bullseye/bookworm/g" /etc/apt/apt.conf
fi
armbian="/etc/apt/sources.list.d/armbian.list"
if [ -f "${armbian}" ]; then
echo "Fixing Armbian repo ..."
echo "deb http://apt.armbian.com bookworm main bookworm-utils" | tee ${armbian}
fi
security="/etc/apt/sources.list.d/openmediavault-os-security.list"
if [ -f "${security}" ]; then
echo "Fixing Debian security repo ..."
echo "deb http://security.debian.org/debian-security bookworm-security main contrib non-free" | tee ${security}
fi
echo "Running apt-get update ..."
apt-get update
echo "Running apt-get dist-upgrade ..."
apt-get --yes \
--option DPkg::Options::="--force-confdef" \
--option DPkg::Options::="--force-confold" \
dist-upgrade
echo "Rebuild apt index ..."
omv-mkaptidx
echo "Done."
exit 0