summaryrefslogtreecommitdiff
path: root/update-me.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-02-12 09:52:48 +0100
committerErich Eckner <git@eckner.net>2020-02-12 09:53:01 +0100
commitb1fd652f1a71ef6cb322bf7a97ee05504943eb7b (patch)
tree52f21ce28403f97b93b7705d03a3152a07df6dfe /update-me.in
parent30a15b5efb8d7cf6a46f42029e6eec5e113ab627 (diff)
downloadupdate-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.in16
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