File size: 515 Bytes
ea90641
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/expect -f

set timeout -1

set username yuxing.chen@unitn.it
set password cyx521301

spawn ./openconnect --protocol=gp vpn.icts.unitn.it --user=$username

expect "Password:*"
send -- "$password\r"

expect eof


##!/bin/bash
#/usr/bin/expect <<EOF
#    set timeout -1
#    set username yuxing.chen@unitn.it
#    set password cyx521301
#    spawn ./openconnect --protocol=gp vpn.icts.unitn.it --user=$username
#    expect {
#        "Password:*" {
#            send -- "$password\r"
#        }
#    }
#EOF