From bb09061c3b02dcfec2a22c5cbed0653613df9e8c Mon Sep 17 00:00:00 2001 From: fabian Date: Fri, 2 Jun 2023 15:57:57 +0200 Subject: [PATCH] improved automatic updates via executeAndNotify to enable fire-and-forget --- home_external/.bash_aliases_extra | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 home_external/.bash_aliases_extra diff --git a/home_external/.bash_aliases_extra b/home_external/.bash_aliases_extra new file mode 100644 index 0000000..ad0a437 --- /dev/null +++ b/home_external/.bash_aliases_extra @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +updateSystem() { + noconfirm= + if [[ $1 == "-y" ]]; then + noconfirm="--assume-yes" + fi + 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; +}