2023-07-06 12:51:55 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
|
|
updatePackages() {
|
|
|
|
noconfirm=
|
|
|
|
if [[ $1 == "-y" ]]; then
|
2024-03-31 23:54:05 +02:00
|
|
|
noconfirm="--assume-yes"
|
2023-07-06 12:51:55 +02:00
|
|
|
fi
|
2024-03-31 23:54:05 +02:00
|
|
|
full=
|
|
|
|
if [[ $2 == "--full" ]]; then
|
|
|
|
full="full-"
|
|
|
|
fi
|
|
|
|
executeAndNotify "doUpdatePackages $noconfirm $full" "system updated" "system update failed";
|
2023-07-06 12:51:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
doUpdatePackages() {
|
2024-03-31 23:54:05 +02:00
|
|
|
sudo apt update;
|
|
|
|
sudo apt ${2}upgrade $1;
|
|
|
|
sudo apt autoremove $1;
|
2023-07-06 12:51:55 +02:00
|
|
|
}
|