From 0e11c52c80613b505b2883910ab6b230c74c87b4 Mon Sep 17 00:00:00 2001 From: GRMrGecko Date: Tue, 7 Jan 2025 22:02:02 -0600 Subject: [PATCH] Move socket to configuration directory. --- config.go | 8 ++++---- main.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.go b/config.go index 39afbff..da1ab23 100644 --- a/config.go +++ b/config.go @@ -77,10 +77,10 @@ type MACEntryConfig struct { } // Applies common filters to the read configuration. -func (c *Config) ApplyFilters() { +func (c *Config) ApplyFilters(configDir string) { // If the RPC path isn't set, set it to temp dir. if c.RPCPath == "" { - c.RPCPath = filepath.Join(os.TempDir(), "virtual-vxlan.sock") + c.RPCPath = filepath.Join(configDir, "virtual-vxlan.sock") } // Check if the RPC socket already exists. _, err := os.Stat(c.RPCPath) @@ -140,7 +140,7 @@ func ReadMinimalConfig() *Config { } // Apply config filters. - config.ApplyFilters() + config.ApplyFilters(fileDir) // Apply any log configurations loaded from file. config.Log.Apply() @@ -163,7 +163,7 @@ func ReadConfig() *Config { } // Apply config filters. - config.ApplyFilters() + config.ApplyFilters(fileDir) // Apply any log configurations loaded from file. config.Log.Apply() diff --git a/main.go b/main.go index 3933fa1..593501a 100644 --- a/main.go +++ b/main.go @@ -6,7 +6,7 @@ const ( serviceDisplayName = "Virtual VXLAN" serviceVendor = "com.mrgeckosmedia" serviceDescription = "Virtual VXLAN using TUN interfaces" - serviceVersion = "0.1.3" + serviceVersion = "0.1.4" defaultConfigFile = "config.yaml" )