#!/bin/bash# Checkifthescriptisrunas rootif [ "$EUID"-ne0 ];thenecho"Please run as root"exit1fiecho"Updating and upgrading current packages..."aptupdate&&aptupgrade-yecho"Installing necessary packages for the upgrade..."aptinstall-yapt-transport-httpsca-certificatesecho"Changing sources.list to Debian 12 (Bookworm)..."sed-i's/buster/bookworm/g'/etc/apt/sources.listsed-i's/bullseye/bookworm/g'/etc/apt/sources.listsed-i's|bullseye-security|bookworm-security|g'/etc/apt/sources.listecho"Updating package lists..."aptupdateecho"Performing the full upgrade to Debian 12..."aptfull-upgrade-yecho"Cleaning up..."aptautoremove--purge-yecho"The upgrade is complete. It is recommended to reboot the system."