From 3424fbc3ac889886e863cb02870e3996f941d043 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sat, 24 Jan 2026 20:23:18 +0100 Subject: [PATCH] Ask the user whether they want to proceed --- arch_update | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch_update b/arch_update index 6975a0a..1a07d67 100755 --- a/arch_update +++ b/arch_update @@ -22,6 +22,24 @@ echo -e '\nChecking for updates ...' >&2 yay -Qua ) | sort -u +# Ask to proceed +while true; do + echo -e '\nDo you want to start the update? Y/n' >&2 + read -r answer || exit 1 + + case $answer in + '' | [yY]) + break + ;; + [nN]) + exit 0 + ;; + *) + echo -e 'Answer with y or n.' >&2 + ;; + esac +done + # Backup system if which btrfs >/dev/null 2>&1; then yay -S --needed --noconfirm snapper