From e94440dc3bc7567c4da8a257c99fd9da5f42cc27 Mon Sep 17 00:00:00 2001 From: Pogobanane Date: Tue, 27 Jun 2023 11:11:30 +0000 Subject: [PATCH] pxe pause: wait for "continue" instead of [enter] --- nixos-anywhere-pxe.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nixos-anywhere-pxe.py b/nixos-anywhere-pxe.py index 26f1b64f..f44e13cf 100644 --- a/nixos-anywhere-pxe.py +++ b/nixos-anywhere-pxe.py @@ -384,12 +384,14 @@ def build_pxe_image(netboot_image_flake: str) -> Path: ) return Path(res.stdout.strip()) - def pause(): print("") - input( - "Press [enter] to terminate this script and tear down the network to the server." - ) + # no clue how to flush stdin with python. Gonna wait for a specific string instead (as opposed to wait for [enter]). + answer = "" + while (answer != "continue"): + answer = input( + "Answer 'continue' to terminate this script and tear down the network to the server: " + ) def dispatch_dnsmasq(