From d66400ef9207b65efef35316f9f2c5f755bfb0ec Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 15 Apr 2020 08:12:43 +0200 Subject: update-me: give opportunity for rescue shell before running post_cmds --- update-me.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/update-me.in b/update-me.in index 7186ece..14d1716 100644 --- a/update-me.in +++ b/update-me.in @@ -58,7 +58,7 @@ if command -v check-kernel >/dev/null; then postCmds+=('check-kernel -r') fi -exit_or_rescue_shell() { +opportunity_for_rescue_shell() { if "${play_it_safe}"; then printf '%s' "$$" >"${safety_file}" if [ -n "${user}" ] && [ "$(whoami)" != "${user}" ]; then @@ -73,7 +73,12 @@ exit_or_rescue_shell() { fi done >&2 printf ' clear.\n' + play_it_safe=false fi +} + +exit_or_rescue_shell() { + opportunity_for_rescue_shell if [ "$1" -eq 0 ]; then >&2 printf '%s: Erfolg\n' "$(hostname)" else @@ -152,6 +157,8 @@ do fi done +opportunity_for_rescue_shell + for cmd in "${postCmds[@]}" do if [ -z "${cmd%%check-kernel*}" ] \ -- cgit v1.2.3