add track contianer to the config path
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -12,4 +12,6 @@ config.json
|
||||
#ignore generated iptables
|
||||
p2p/iptable/
|
||||
#ignore plugins added
|
||||
plugin/deploy/
|
||||
plugin/deploy/
|
||||
#ignore track container file
|
||||
client/trackcontianers/
|
||||
1
client/trackcontainers.go
Normal file
1
client/trackcontainers.go
Normal file
@@ -0,0 +1 @@
|
||||
package client
|
||||
0
client/trackcontainers/.gitkeep
Normal file
0
client/trackcontainers/.gitkeep
Normal file
0
client/trackcontianers.json
Normal file
0
client/trackcontianers.json
Normal file
@@ -21,12 +21,13 @@ var (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
IPTable string
|
||||
DockerContainers string
|
||||
DefaultDockerFile string
|
||||
SpeedTestFile string
|
||||
IPV6Address string
|
||||
PluginPath string
|
||||
IPTable string
|
||||
DockerContainers string
|
||||
DefaultDockerFile string
|
||||
SpeedTestFile string
|
||||
IPV6Address string
|
||||
PluginPath string
|
||||
TrackContainersPath string
|
||||
//NetworkInterface string
|
||||
//NetworkInterfaceIPV6Index int
|
||||
}
|
||||
@@ -74,12 +75,18 @@ func SetDefaults() error {
|
||||
//Setting current directory to default path
|
||||
defaultPath = curDir + "/"
|
||||
|
||||
//Create ip_table.json in the json directory
|
||||
//Creates ip_table.json in the json directory
|
||||
err := Copy("p2p/ip_table.json","p2p/iptable/ip_table.json")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
//Creates a copy of trackcontainers.json in the appropriate directory
|
||||
err = Copy("p2p/trackcontainers.json","client/trackcontainers/trackcontainers.json")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
//Setting default paths for the config file
|
||||
defaults["IPTable"] = defaultPath + "p2p/iptable/ip_table.json"
|
||||
@@ -88,6 +95,7 @@ func SetDefaults() error {
|
||||
defaults["SpeedTestFile"] = defaultPath + "p2p/50.bin"
|
||||
defaults["IPV6Address"] = ""
|
||||
defaults["PluginPath"] = defaultPath + "plugin/deploy"
|
||||
defaults["TrackContainersPath"] = defaultPath + "client/trackcontainers/trackcontainers.json"
|
||||
//defaults["NetworkInterface"] = "wlp0s20f3"
|
||||
//defaults["NetworkInterfaceIPV6Index"] = "2"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user