From 4a43285ae266333373c3fed6f41a8808b84eaea0 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:41:57 -0400 Subject: [PATCH] Add interactive shell too --- templates/9990-initramfs-tools.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/9990-initramfs-tools.sh b/templates/9990-initramfs-tools.sh index d0af227..606cf4e 100755 --- a/templates/9990-initramfs-tools.sh +++ b/templates/9990-initramfs-tools.sh @@ -57,7 +57,13 @@ panic() printf " $@\n\n" # Reboot system - printf "System will reboot in 30 seconds.\n" - sleep 30 - reboot -f + printf "System will reboot in 30 seconds. Press any key to spawn a shell instead.\n" + if ! read -t 30; then + sleep 30 + reboot -f + fi + + # Call original panic + . /scripts/functions + panic "$@" }