Move socket to configuration directory.
This commit is contained in:
parent
5dd0717085
commit
0e11c52c80
@ -77,10 +77,10 @@ type MACEntryConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Applies common filters to the read configuration.
|
// 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 the RPC path isn't set, set it to temp dir.
|
||||||
if c.RPCPath == "" {
|
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.
|
// Check if the RPC socket already exists.
|
||||||
_, err := os.Stat(c.RPCPath)
|
_, err := os.Stat(c.RPCPath)
|
||||||
@ -140,7 +140,7 @@ func ReadMinimalConfig() *Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Apply config filters.
|
// Apply config filters.
|
||||||
config.ApplyFilters()
|
config.ApplyFilters(fileDir)
|
||||||
|
|
||||||
// Apply any log configurations loaded from file.
|
// Apply any log configurations loaded from file.
|
||||||
config.Log.Apply()
|
config.Log.Apply()
|
||||||
@ -163,7 +163,7 @@ func ReadConfig() *Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Apply config filters.
|
// Apply config filters.
|
||||||
config.ApplyFilters()
|
config.ApplyFilters(fileDir)
|
||||||
|
|
||||||
// Apply any log configurations loaded from file.
|
// Apply any log configurations loaded from file.
|
||||||
config.Log.Apply()
|
config.Log.Apply()
|
||||||
|
2
main.go
2
main.go
@ -6,7 +6,7 @@ const (
|
|||||||
serviceDisplayName = "Virtual VXLAN"
|
serviceDisplayName = "Virtual VXLAN"
|
||||||
serviceVendor = "com.mrgeckosmedia"
|
serviceVendor = "com.mrgeckosmedia"
|
||||||
serviceDescription = "Virtual VXLAN using TUN interfaces"
|
serviceDescription = "Virtual VXLAN using TUN interfaces"
|
||||||
serviceVersion = "0.1.3"
|
serviceVersion = "0.1.4"
|
||||||
defaultConfigFile = "config.yaml"
|
defaultConfigFile = "config.yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user