Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sending multiple commands to a running instance #502

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

selvanair
Copy link
Collaborator

Make it possible to use --command action arg multiple times.
See Trac #498
Summary of commits:
(i) Usages like --command connect vpn1 --command connect vpn2 --command disconnect vpn3 when the GUI is already running is now supported.
(ii) When sending multiple commands to a running instance of the GUI, simplify usage of the form
openvpn-gui.exe --command connect vpn1 --command connect vpn2 --command disconnect vpn3
by omitting command so that one could also write
openvpn-gui.exe --connect vpn1 --connect vpn2 --disconnect vpn3 For connect this already worked, but do so for other commands too.
(iii) copy resource file changes to all langauge files

Currently we support only one --command action arg
type of option. Extend it to allow multiple such commands
in one invocation.

Trac OpenVPN#498

Signed-off-by: Selva Nair <selva.nair@gmail.com>
When sending multiple commands to a running instance of the GUI,
simplify usage like

openvpn-gui.exe --command connect vpn1 --command connect vpn2
      --command disconnect vpn3

by omitting --command so that one could write

openvpn-gui.exe --connect vpn1 --connect vpn2 --disconnect vpn3

The form "--command action .. " was introduced originally to indicate that
these actions are only understood if there is an instance of the gui
already running as it just triggers a message for that action to be sent to
the first instance. But it becomes tedious when multiple commands are to
be specified.

This patch makes --action arg  to also work the same way as
--command action arg. A side effect is that some of such options do not
make sense when launching the first instance of the GUI. In such cases,
the option is ignored but an error is logged to the eventlog. In particular,
use of options such as --command disconnect or --disconnect with the first
instance are no longer treated as a fatal error.

The allowed values of action are unchanged:
  connect
  disconnect
  reconnect
  disconnect_all
  exit
  status
  silent_connection
  import
  rescan
out of which connect, silent_connection and import are the only
one's that could be handled by the first instance.

Example:

openvpn-gui.exe --connect vpn1 --connect vpn2

will start vpn1 and vpn2 if OpenVPN-GUI is not already running,
or cause a command to start those sent to a running instance.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Signed-off-by: Selva Nair <selva.nair@gmail.com>
@selvanair selvanair linked an issue Dec 20, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple VPN's in a go
1 participant