diff options
author | Erich Eckner <git@eckner.net> | 2020-02-12 09:52:48 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-02-12 09:53:01 +0100 |
commit | b1fd652f1a71ef6cb322bf7a97ee05504943eb7b (patch) | |
tree | 52f21ce28403f97b93b7705d03a3152a07df6dfe /update-me.in | |
parent | 30a15b5efb8d7cf6a46f42029e6eec5e113ab627 (diff) | |
download | update-all-b1fd652f1a71ef6cb322bf7a97ee05504943eb7b.tar.xz |
update-me: give opportunity for a rescue shell in case of exit
Diffstat (limited to 'update-me.in')
-rw-r--r-- | update-me.in | 16 |
1 files 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 |