From 54c7b0952490a7c787ecace745227970c78a1c46 Mon Sep 17 00:00:00 2001 From: velvettear Date: Tue, 10 Dec 2024 09:39:19 +0100 Subject: [PATCH] fix update script (specifically for debian) --- scripts/update/debian.sh | 4 ++-- scripts/update/update.sh | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/update/debian.sh b/scripts/update/debian.sh index 30a1f5f..b2639fd 100755 --- a/scripts/update/debian.sh +++ b/scripts/update/debian.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env zsh # author: Daniel Sommer # license: MIT @@ -39,7 +39,7 @@ printf ""$font_colored"> removing orphaned packages..."$font_default"\n" printf ""$font_colored_bold">> system updated finished after "$SECONDS" seconds!"$font_default"\n" -[[ ! "$reboot" ]] && exit 0 +[[ -z "$reboot" ]] && exit 0 timeout="5" printf ""$font_colored"> rebooting system in " diff --git a/scripts/update/update.sh b/scripts/update/update.sh index 496d136..a4677d5 100755 --- a/scripts/update/update.sh +++ b/scripts/update/update.sh @@ -10,15 +10,9 @@ script="$(dirname $(realpath $0))/$distro.sh" # check if update script exists [[ ! -x "$script" ]] && printf "error: update script '"$script"' does not exist or is not executable!\n" >&2 && exit 1 -args="" -for arg in "$@"; do - [[ -n "$args" ]] && args="$args " - args="$args$arg" -done - # execute update script if [[ "$(id -u)" -eq 0 ]] || [[ "$distro" == "arch" ]]; then - "$script" $args + "$script" $@ else - sudo "$script" $args + sudo "$script" $@ fi