backup-fs: attempt to fix not properly taking input on shutdown

master
BodgeMaster 2023-06-29 13:36:21 +02:00
parent 257f70ebe8
commit 48f01de830
1 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,8 @@
function yesno {
unset DISCARD_ME
while [ -z "$DISCARD_ME" ]; do
read -p "[y/n] " -n1 DISCARD_ME
# get input from /dev/tty to work around missing stdin
read -p "[y/n] " -n1 DISCARD_ME < /dev/tty
case "$DISCARD_ME" in
y)
return 0
@ -24,14 +25,14 @@ function yesno {
cat /proc/mounts
read -p "
press any key" -n1 DISCARD_ME
press any key" -n1 DISCARD_ME < /dev/tty
# And no services running?
ps aux | grep -vF "[kworker"
read -p "
press any key" -n1 DISCARD_ME
press any key" -n1 DISCARD_ME < /dev/tty
#TODO: remove above debugging sanity checks