From b1fd652f1a71ef6cb322bf7a97ee05504943eb7b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 12 Feb 2020 09:52:48 +0100 Subject: update-me: give opportunity for a rescue shell in case of exit --- update-me.in | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/update-me.in b/update-me.in index 1df456d..cb5ce13 100644 --- a/update-me.in +++ b/update-me.in @@ -20,6 +20,14 @@ if command -v check-kernel >/dev/null; then postCmds+=('check-kernel -r') fi +exit_or_rescue_shell() { + read s + if [ -n "${s}" ]; then + bash + fi + exit $1 +} + . #ETCDIR#/update-me.conf if ! command -v sudo >/dev/null; then @@ -74,7 +82,7 @@ do then >&2 printf '%s: Fehler\n' "$(hostname)" read s - exit ${err} + exit_or_rescue_shell ${err} fi done @@ -86,7 +94,7 @@ do then >&2 printf '%s: Fehler\n' "$(hostname)" read s - exit ${err} + exit_or_rescue_shell ${err} fi done @@ -103,10 +111,10 @@ do then >&2 printf '%s: Fehler\n' "$(hostname)" read s - exit ${err} + exit_or_rescue_shell ${err} fi done >&2 printf '%s: Erfolg\n' "$(hostname)" read s -exit 0 +exit_or_rescue_shell 0 -- cgit v1.2.3-54-g00ecf