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

Autostart config dir #10

Merged
merged 2 commits into from Nov 29, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

Change registry value for config directory to autostart_config_dir

This allows to isolate autostarted configs from those accessed
through the GUI into separate directories.

This also allows setting the service start type to default to Auto
(not manual) without unexpectedly starting profiles in config_dir.

If the registry value does not exist or is empty it is ignored. Otherwise
it must point to a directory that exists. The installer should set up
a default value and default directory.

See
OpenVPN/openvpn-build#141 (comment)
and subsequent discussion.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
  • Loading branch information...
selvanair committed Nov 29, 2018
commit f39b86ed27fd8f131b472498bf2ffc233761681e
@@ -97,7 +97,7 @@ protected override void OnStart(string[] args)
var config = new OpenVpnServiceConfiguration()
{
exePath = (string)rkOvpn.GetValue("exe_path"),
configDir = (string)rkOvpn.GetValue("config_dir"),
configDir = (string)rkOvpn.GetValue("autostart_config_dir"),
configExt = "." + (string)rkOvpn.GetValue("config_ext"),
logDir = (string)rkOvpn.GetValue("log_dir"),
logAppend = append,
@@ -106,7 +106,7 @@ protected override void OnStart(string[] args)
eventLog = EventLog,
};

if (configDirsConsidered.Contains(config.configDir)) {
if (String.IsNullOrEmpty(config.configDir) || configDirsConsidered.Contains(config.configDir)) {
continue;
}
configDirsConsidered.Add(config.configDir);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.