-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo_viewer.exp
41 lines (36 loc) · 937 Bytes
/
video_viewer.exp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/expect -f
log_user 0
set RSUIP [lindex $argv 0]
set Mv2_IP [lindex $argv 1]
set Mv2_USERNAME [lindex $argv 2]
set Mv2_PWD [lindex $argv 3]
set IP [lindex $argv 4]
set USERNAME [lindex $argv 5]
set PWD [lindex $argv 6]
set timeout -1
spawn ssh ${Mv2_USERNAME}@${Mv2_IP}
expect {
"yes" {
send "yes\n"
expect "*password:" { send "${Mv2_PWD}\n" }
}
"*password:" { send "${Mv2_PWD}\n" }
timeout { send_error "User 'root' login timeout.\n"; exit 1; }
}
expect "*~"
send "ssh -L 1234:${RSUIP}:1234 ${USERNAME}@${IP} -fN\r"
expect {
"yes" {
send "yes\n"
expect "*password:" { send "${PWD}\n" }
}
"*password:" { send "${PWD}\n" }
timeout { send_error "User 'root' login timeout.\n"; exit 1; }
}
expect "*~"
send "export DISPLAY=:0\r"
expect "*~"
send "vlc --fullscreen rtsp://localhost:1234/test --network-caching=200\r"
expect "*~"
send "exit\r"
interact