1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/expect set args [lrange $argv 0 end] set timeout 300 spawn debvm-run {*}$args expect "root@testvm:~#" set timeout 10 send "echo 6coF0JBW\$((2+3))\r" expect { "6coF0JBW5" { } timeout { exit 1 } } expect "root@testvm:~#" send "poweroff\r" set timeout 120 expect eof