ubuntu tools misc
This commit is contained in:
@@ -1,19 +1,6 @@
|
||||
# Shell scripts
|
||||
|
||||
## Russian
|
||||
# Shell-скрипты
|
||||
|
||||
Эти скрипты я писал в разное время для решения разных задач.
|
||||
Чтобы они не растерялись по репозиториям и носителям, я решил собрать их здесь в одну кучу.
|
||||
|
||||
Я всегда использую Ubuntu в качестве своих настольных и серверных ОС, поэтому все эти скрипты писались и использовались в этих средах с версий 18.*.
|
||||
|
||||
Многие скрипты зависимы от [io.sh](/io.sh).
|
||||
|
||||
## English
|
||||
|
||||
These scripts were written at different times to solve different my own problems.
|
||||
I decided to collect them here in a heap so that they are not lost in repositories and media.
|
||||
|
||||
I always use Ubuntu as my desktop and server OS, so all these scripts has been written and used in these environments since version 18.*.
|
||||
|
||||
Many scripts depending on [io.sh](/io.sh).
|
||||
|
||||
@@ -2,23 +2,11 @@
|
||||
# https://dev.to/chefgs/upgrading-an-end-of-life-eol-ubuntu-os-to-lts-version-3a36
|
||||
# https://changelogs.ubuntu.com/meta-release
|
||||
|
||||
installed() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# sudo software-properties-qt (переключиться с LTS на нормальные релизы)
|
||||
# sudo aptitude install update-manager-core update-manager
|
||||
# sudo apt upgrade --autoremove -y
|
||||
# installed pkcon && sudo pkcon update --autoremove -y
|
||||
# sudo apt dist-upgrade
|
||||
# sudo apt install update-manager-core
|
||||
# sudo do-release-upgrade -p
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source /etc/os-release
|
||||
|
||||
echo "Loading..."
|
||||
|
||||
IFS=$'\n' codenames=($(curl -s https://changelogs.ubuntu.com/meta-release | grep -xP "^Dist:\s[\w]+$" | sed "s/Dist: //" ))
|
||||
mapfile -t codenames < <(curl -s https://changelogs.ubuntu.com/meta-release | grep -oP '(?<=Dist:\s).*')
|
||||
thisCodename="$VERSION_CODENAME"
|
||||
for idx in "${!codenames[@]}"; do
|
||||
if [ "${codenames[idx]}" = "$thisCodename" ]; then
|
||||
@@ -26,7 +14,7 @@ for idx in "${!codenames[@]}"; do
|
||||
fi
|
||||
done
|
||||
|
||||
targetDownloadPath="`pwd`/upgrade-$nextCodename"
|
||||
targetDownloadPath="$(pwd)/upgrade-$nextCodename"
|
||||
targetToolPath="$targetDownloadPath/unpacked"
|
||||
targetToolFile="$targetDownloadPath/$nextCodename.tar.gz"
|
||||
|
||||
@@ -38,12 +26,14 @@ rm -rf "$targetToolPath"
|
||||
mkdir -p "$targetToolPath"
|
||||
|
||||
echo "Downloading..."
|
||||
cd "$targetDownloadPath"
|
||||
cd "$targetDownloadPath" || exit 1
|
||||
wget "http://archive.ubuntu.com/ubuntu/dists/${nextCodename}-updates/main/dist-upgrader-all/current/${nextCodename}.tar.gz"
|
||||
|
||||
echo "Unpacking..."
|
||||
tar -xaf "$targetToolFile" -C "$targetToolPath"
|
||||
|
||||
echo "Starting..."
|
||||
cd unpacked
|
||||
cd ./unpacked || exit 1
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
sudo ./$nextCodename
|
||||
Reference in New Issue
Block a user