summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-04-15 08:12:43 +0200
committerErich Eckner <git@eckner.net>2020-04-15 08:12:43 +0200
commitd66400ef9207b65efef35316f9f2c5f755bfb0ec (patch)
treea113445a1afe92e67543d06767a9aaeebea7e89b
parentbcc71c94e920cfae54df587486741cc445f36240 (diff)
downloadupdate-all-d66400ef9207b65efef35316f9f2c5f755bfb0ec.tar.xz
update-me: give opportunity for rescue shell before running post_cmds
-rw-r--r--update-me.in9
1 files changed, 8 insertions, 1 deletions
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*}" ] \