Upgrade Skript von Patrick

Er hat ein Tool geschrieben welches einfach alle Updates herunterzieht und installiert.

Einfach diese Datei, wie Patrick es beschrieben hat ausführen:

“Das Upgrade-Script (Paketsynctool) einfach im Verzeichnies /usr/local/bin/ ablegen, ausführbar machen (chmod +x /usr/local/bin/upgrade) und schon kannst du, egal, in welchem Pfad du gerade stehst, das Tool mit “upgrade” (natürlich ohne “”) aufrufen.”

Ich habe in der Konsole mit sudo -i starten, dann ging es. Allerdings konnte ich die Datei nur in den Downloadsordner legen. So wie der oben beschriebenen Ordner wollte mein Manjaro es einfach nicht der Schlingel.

#!/bin/bash

os_release="/etc/os-release"

if [ ! "$(id -u)" = "0" ]
then
        echo "you are not root"
        exit 1
fi

os=$(grep "^NAME" $os_release | cut -d \" -f 2)

case $os in
        "CentOS Linux")
                yum makecache && yum update
        ;;
        "Ubuntu" | "Kali GNU/Linux" | "Linux Mint" )
                apt update && apt upgrade && apt-get autoremove
        ;;
        "Debian GNU/Linux" )
                apt update && apt upgrade && apt autoremove
        ;;
        "Raspbian GNU/Linux" )
                aptitude update && aptitude safe-upgrade && aptitude autoclean
        ;;
        "openSUSE" | "SLED" | "SLES" )
                zypper refresh && zypper update
        ;;
        "Manjaro Linux" )
                if [ "$(find /var/lib/pacman-mirrors/ -name status.json -mmin +40)" = "" ]
                then
                        pacman -Syuu --noconfirm
                else
                        pacman-mirrors -c de && pacman -Syyu --noconfirm
                fi
        ;;
        "Fedora Linux" )
                dnf makecache && dnf update && dnf autoremove
        ;;
        *)
                echo "OS not supported"
                exit 1
esac

Datei: