How to use a linux expect script to enter answer a prompt for password

前端 未结 4 503
忘掉有多难
忘掉有多难 2021-01-19 00:05

I am having some trouble writing a script that will launch my forticlient vpn command line client and send my password when it is prompted. Here is my code:



        
4条回答
  •  醉酒成梦
    2021-01-19 00:23

    You may use forticlientsslvpn_cli with Expect to feed in the password.

    A complete solution available here:

    https://gist.github.com/azizasm/e216bc47b54f5b68405f3c8f8b832e8a

    Note: this solution will auto reconnect the if the VPN get disconnected.

提交回复
热议问题