-
-
Save grahamc/6102cf7acb8b631a65348c944e565a4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set attempts 0 | |
while true { | |
expect { | |
-i $console -exact "*NixOS - Default" { | |
# Fallback from the above, go down an entry | |
send -i $console -- \x1B\[B; | |
} | |
-i $console -exact "*NixOS - All configurations" { | |
# Enter the All configs menu when it is selected (*) | |
send -i $console "\n" | |
puts ">>> WOULD ENTER ALL CONFIGURATIONS" | |
} | |
-i $console -exact "NixOS - All configurations" { | |
# Fallback from the above, go down an entry | |
send -i $console -- \x1B\[A; | |
} | |
-i $console -exact "Configuration 2" { | |
puts ">>>> CONFIGURATION 2 LOOKS GOOD" | |
break | |
} | |
-i $console "NixOS Stage" { | |
puts "!!!!!!!! MISSED GRUB !!!!!!!" | |
exit 1 | |
} | |
timeout { | |
# Zip up to the top/bottom/top to try again ... | |
for {set x 0} {$x<5} {incr x} { | |
after 100 | |
send -i $console -- \x1B\[A; | |
} | |
for {set x 0} {$x<5} {incr x} { | |
after 100 | |
send -i $console -- \x1B\[B; | |
} | |
for {set x 0} {$x<5} {incr x} { | |
after 100 | |
send -i $console -- \x1B\[A; | |
} | |
for {set x 0} {$x<5} {incr x} { | |
after 100 | |
send -i $console -- \x1B\[B; | |
} | |
if { $attempts > 1000 } { | |
puts "failed to find the Configuration 2 in the bootloader" | |
exit 1 | |
} | |
incr attempts | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment