improved automatic updates via executeAndNotify to enable fire-and-forget
This commit is contained in:
parent
452fd7600d
commit
647831e860
@ -1,9 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
updateSystem() {
|
||||
noconfirm=
|
||||
if [[ $1 == "-y" ]]; then
|
||||
noconfirm="-y"
|
||||
noconfirm="--assume-yes"
|
||||
fi
|
||||
sudo apt update;
|
||||
sudo apt upgrade $noconfirm;
|
||||
sudo apt autoremove $noconfirm;
|
||||
full=
|
||||
if [[ $2 == "--full" ]]; then
|
||||
full="full-"
|
||||
fi
|
||||
executeAndNotify "doUpdateSystem $noconfirm $full" "system updated" "system update failed";
|
||||
}
|
||||
|
||||
|
||||
doUpdateSystem() {
|
||||
sudo apt update;
|
||||
sudo apt ${2}upgrade $1;
|
||||
sudo apt autoremove $1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user