File: shell_interaction.expect

package info (click to toggle)
debvm 0.5.0
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 212 kB
  • sloc: sh: 2,336; exp: 14; makefile: 5
file content (15 lines) | stat: -rwxr-xr-x 267 bytes parent folder | download | duplicates (3)
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 {*}$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