summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-05-08 23:10:18 +0200
committerErich Eckner <git@eckner.net>2020-05-08 23:10:18 +0200
commit3c6d2ceb5905ad2a2c24a2443168e1dbeeaa5f2a (patch)
tree58c0289c5d509fd550d19d1df1505a9287cc0123
parentb70ce85da9d518a570eab1aaa1a0f0c033d05d9b (diff)
downloadupdate-all-3c6d2ceb5905ad2a2c24a2443168e1dbeeaa5f2a.tar.xz
update-me: flush stdin before waiting for input
-rw-r--r--update-me.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/update-me.in b/update-me.in
index 7d12443..5b80572 100644
--- a/update-me.in
+++ b/update-me.in
@@ -73,6 +73,9 @@ opportunity_for_rescue_shell() {
chown "${user}" "${safety_file}"
fi
>&2 printf '%s: waiting for clearance ...' "$(hostname)"
+ while read -t 0.0001; do
+ :
+ done
while [ -f "${safety_file}" ] && [ "$(cat "${safety_file}")" = "$$" ]; do
if read -t 1; then
>&2 printf ' rescue shell!\n'
@@ -92,6 +95,9 @@ exit_or_rescue_shell() {
else
>&2 printf '%s: Fehler\n' "$(hostname)"
fi
+ while read -t 0.0001; do
+ :
+ done
read s
if [ -n "${s}" ]; then
bash
@@ -161,6 +167,9 @@ do
err=$?
while [ ${err} -ne 0 ]; do
>&2 printf '%s (%s): Fehler - nochmal versuchen?\n' "$(hostname)" "${cmd}"
+ while read -t 0.0001; do
+ :
+ done
read s
if [ -n "${s}" ]; then
break