2023-06-02 15:57:57 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-05-31 10:55:35 +02:00
|
|
|
updateSystem() {
|
|
|
|
noconfirm=
|
|
|
|
if [[ $1 == "-y" ]]; then
|
2023-06-02 15:57:57 +02:00
|
|
|
noconfirm="--assume-yes"
|
2023-05-31 10:55:35 +02:00
|
|
|
fi
|
2023-06-02 15:57:57 +02:00
|
|
|
full=
|
|
|
|
if [[ $2 == "--full" ]]; then
|
|
|
|
full="full-"
|
|
|
|
fi
|
|
|
|
executeAndNotify "doUpdateSystem $noconfirm $full" "system updated" "system update failed";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
doUpdateSystem() {
|
2023-05-31 10:55:35 +02:00
|
|
|
sudo apt update;
|
2023-06-02 15:57:57 +02:00
|
|
|
sudo apt ${2}upgrade $1;
|
|
|
|
sudo apt autoremove $1;
|
2023-05-31 10:55:35 +02:00
|
|
|
}
|