Skip to content

Commit a694b3e

Browse files
committed
pxe pause: wait for "continue" instead of [enter]
1 parent b36be63 commit a694b3e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

nixos-anywhere-pxe.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,14 @@ def build_pxe_image(netboot_image_flake: str) -> Path:
384384
)
385385
return Path(res.stdout.strip())
386386

387-
388387
def pause():
389388
print("")
390-
input(
391-
"Press [enter] to terminate this script and tear down the network to the server."
392-
)
389+
# no clue how to flush stdin with python. Gonna wait for a specific string instead (as opposed to wait for [enter]).
390+
answer = ""
391+
while (answer != "continue"):
392+
answer = input(
393+
"Answer 'continue' to terminate this script and tear down the network to the server: "
394+
)
393395

394396

395397
def dispatch_dnsmasq(

0 commit comments

Comments
 (0)