From f14b491890a3192d7048d40ce29fa0ebcd91a6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Sat, 19 May 2018 22:59:54 +0200 Subject: [PATCH] system-upgrade: add wait option This is used to keep the screen output from disapear --- system-upgrade | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/system-upgrade b/system-upgrade index 26c872e..9382c58 100755 --- a/system-upgrade +++ b/system-upgrade @@ -19,6 +19,7 @@ # Smart way to update your archlinux system SCREEN=screen +WAIT=0 PACMAN_OPTS=() # run system upgrade and checkservices @@ -57,9 +58,10 @@ usage() { # set options as global vars argparse() { local opt - while getopts 'hS' opt; do + while getopts 'hSw' opt; do case $opt in S) SCREEN='';; + w) WAIT=1;; *) usage;; esac done @@ -74,7 +76,7 @@ main() { if [[ -z "$STY" && -z "$TMUX" && -n "$SCREEN" ]] && type -P $SCREEN >/dev/null then - exec $SCREEN "$0" -S "$@" + exec $SCREEN "$0" -S -w "$@" fi # be root @@ -84,6 +86,10 @@ main() { # relly do the job upgrade + + if (( $WAIT == 1 )); then + read -r -p "Type enter to quit" + fi } main "$@" -- GitLab