diff --git a/ubuntu-20.04/ubuntu-up.sh b/ubuntu-20.04/ubuntu-up.sh new file mode 100644 index 0000000..259bbce --- /dev/null +++ b/ubuntu-20.04/ubuntu-up.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +declare -r FREEMEM=$(free |grep Mem: | awk '{print $4}') + +if [ "${FREEMEM}" -lt 130000 ]; then + echo "Not enough free ram, exiting" + exit 1 +fi + + + + +sed -i 's/focal/jammy/' /etc/apt/sources.list +sed -i 's/focal/jammy/' /etc/apt/sources.list.d/* +# Check other sources if needed + + +# Can resolve dpkg issue : +# echo "" > /var/lib/dpkg/available +# sh -c 'for i in /var/lib/apt/lists/*_Packages; do dpkg --merge-avail "$i"; done' + +apt update +apt dist-upgrade -y +apt autoclean -y +apt autopurge -y + +#if [ -d /sys/firmware/efi ]; then +# if [ -d /etc/pve ]; then +# apt install -y systemd-boot +# fi +#fi + + +echo "" +hostname +read -n 1 -s -r -p "Press any key to reboot" +reboot diff --git a/ubuntu-up.sh b/ubuntu-up.sh new file mode 100644 index 0000000..f587dfd --- /dev/null +++ b/ubuntu-up.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +declare BASE_URL=https://git.netm.ch/m/os-init/raw/branch/main +declare UBUNTUVER=0 + +getVer() { + UBUNTUVER=$(grep "VERSION_ID=" /etc/os-release | sed 's/"//g' | sed 's/.*=//') +} + +run() { + apt update -y + apt install -y wget + wget -P /tmp ${BASE_URL}/ubuntu-${UBUNTUVER}/ubuntu-up.sh + bash /tmp/ubuntu-up +} + +getVer +run