title: OpenConnect autoconnect/reconnect script?
body: <p>I have this script:</p>
  
  <pre><code>#!bin/bash
  NAME="user"
  PIDFILE="openconnect.pid"
  CERT="user.crt"
  KEY="user.key"
  PASS="pass"
  HOST="https://example.com"
  SCRIPT="/etc/vpnc/vpnc-script"
  
  openconnect -b --script $SCRIPT --pid-file=$PIDFILE -c $CERT -k $KEY --key-password=$PASS --user=$NAME $HOST
  </code></pre>
  
  <p>It works, but sometimes if something goes wrong (restart of server, or some other issues), it disconnects from VPN. And I need to rerun script again. Is there some way I could modify it or add it in cron job or some other way?</p>
  
  <p><strong>Note</strong>. When I run this script I need to enter certificate password. So considering security, I'm wondering where I should keep that password for autoreconnect purposes?</p>