Discussion:
Disconnect VPN connection when running in background?
(too old to reply)
Joseph T Bradley
2015-05-17 21:53:52 UTC
Permalink
Is there a disconnect option, that I can use to disconnect
openconnect, after I've started it in background mode? I am on Linux
Mint 17.1, if it matters. Thanks.

Joseph
--
Confidentiality Notice: The information in this e-mail message, including
any attachments thereto, is intended to be confidential and is for the use
of the individual or entity named above. If the reader of this message is
not the intended recipient, you are hereby notified that retention,
dissemination, distribution, or copying of this message is strictly
prohibited. If you receive this message in error, please notify the sender
and delete the material immediately.
Stuart Luppescu
2015-05-18 02:00:57 UTC
Permalink
Post by Joseph T Bradley
Is there a disconnect option, that I can use to disconnect
openconnect, after I've started it in background mode? I am on Linux
Mint 17.1, if it matters. Thanks.
I call a little script like this:
#!/bin/bash
kill `ps aux|grep openconnect|grep -v grep|cut -c 10-15`

Don't know if this is the recommended procedure but it works for me.
--
Stuart Luppescu <***@ccsr.uchicago.edu>
Kevin Cernekee
2015-05-18 02:26:18 UTC
Permalink
Post by Stuart Luppescu
Post by Joseph T Bradley
Is there a disconnect option, that I can use to disconnect
openconnect, after I've started it in background mode? I am on Linux
Mint 17.1, if it matters. Thanks.
#!/bin/bash
kill `ps aux|grep openconnect|grep -v grep|cut -c 10-15`
Don't know if this is the recommended procedure but it works for me.
If there is only one openconnect instance running, you can also use
killall or pkill. The supported signals are listed in the man page.
Usually you'll want to use SIGINT for a clean disconnection.

If you're running multiple instances, it's probably easiest to use
something like "--pid-file /var/run/openconnect.foo" so you can easily
determine the PID for each connection.

Loading...