Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created June 6, 2018 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/77693e6132f72ff61be44b656c0ecdfc to your computer and use it in GitHub Desktop.
Save grahamc/77693e6132f72ff61be44b656c0ecdfc to your computer and use it in GitHub Desktop.
set uuid [lindex $argv 0];
set region [lindex $argv 1];
# connect to the serial console over ssh
spawn ./console.sh "$uuid" "$region"
set timeout 1200
send "\n"
set UP \x1B\[A;
set DOWN \x1B\[B;
expect {
"NixOS - All configurations" {
puts ">>>> GRUB LOOKS GOOD"
}
}
set timeout 1
while true {
expect {
"NixOS" {
puts "cool"
break
}
timeout {
send -- \x1B\[A;
send -- \x1B\[B;
}
}
}
send "\r\n"
while true {
expect {
"Configuration 2" {
puts ">>>> CONFIGURATION 2 LOOKS GOOD"
break
}
timeout {
send -- \x1B\[A;
send -- \x1B\[B;
}
}
}
send -- \x1B\[B;
send "\r\n"
set timeout 1200
expect {
"Welcome to NixOS" {
puts ">>>> BOOTED"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment