add track contianer to the config path

This commit is contained in:
2021-07-17 12:32:49 +04:00
parent 739c7305a8
commit 92cd9fe1ab
5 changed files with 19 additions and 8 deletions

4
.gitignore vendored
View File

@@ -12,4 +12,6 @@ config.json
#ignore generated iptables
p2p/iptable/
#ignore plugins added
plugin/deploy/
plugin/deploy/
#ignore track container file
client/trackcontianers/

View File

@@ -0,0 +1 @@
package client

View File

View File

View 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"