Generate a default client lokinet.ini on startup if it doesn't exist

Thus when a user goes looking for it they'll find the (commented out)
default in the right place and can edit it.

(That right place is: ~/Library/Containers/com.loki-project.lokinet.network-extension/Data/lokinet.ini)
pull/1688/head
Jason Rhinelander 3 years ago committed by Jeff Becker
parent fec3598e16
commit 58da228f62
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -40,9 +40,9 @@ llarp_apple_init(
{
auto config_dir = fs::u8path(config_dir_);
auto config = std::make_shared<llarp::Config>(config_dir);
std::optional<fs::path> config_path = config_dir / "lokinet.ini";
if (!fs::exists(*config_path))
config_path.reset();
fs::path config_path = config_dir / "lokinet.ini";
if (!fs::exists(config_path))
llarp::ensureConfig(config_dir, config_path, /*overwrite=*/ false, /*router=*/ false);
config->Load(config_path);
// If no range is specified then go look for a free one, set that in the config, and then return

Loading…
Cancel
Save