自动输入用户名密码脚本
manjaro 连接vpn
需要安装 expect
#!/usr/bin/expect
vpn_host='' group='' user_name='' password='' spawn sudo openconnect --csd-wrapper=/usr/lib/openconnect/csd-post.sh ${vpn_host} expect { "*GROUP:*" { set timeout 300 send "${group}\r" exp_continue } "*Username:*" { set timeout 300 send "${user_name}\r" exp_continue } "*Password:*" { set timeout 300 send "${password}\r" exp_continue } timeout { puts "connect is timeout" exit 3 } }