On Mon, 2018-06-25 at 12:32 +0300, Basin Ilya wrote: > Hi. > I'm trying to make a wrapper for Openconnect that uses its own > password manager. The wrapper should relaunch Openconnect infinitely, > when it fails to connect (possibly due to a temporary network > problem), but it shouldn't when the password is bad to avoid a user > lockout. > > How can the wrapper distinguish the failure reason? The exit code is > always 1. Er... shouldn't we be returning '2' for an auth failure? I thought I 'inherited' that behaviour from vpnc? I'd do this by separating out the auth from the connection. First do 'openconnect --authenticate', entirely under your own control. Then use the resulting cookie until it expires (at which point I'm fairly sure you *do* get a '2' return code). Repeat. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 5213 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/openconnect-devel/attachments/20180625/e37b54a3/attachment.bin>