From 647831e8601b9a40a60b0151bb55bb9ff0dfffca 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 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/home_external/.bash_aliases_extra b/home_external/.bash_aliases_extra index 799fcb5..ad0a437 100644 --- a/home_external/.bash_aliases_extra +++ b/home_external/.bash_aliases_extra @@ -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; }