diff --git a/.gitignore b/.gitignore index a5739d2..36431ac 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,6 @@ config.json #ignore generated iptables p2p/iptable/ #ignore plugins added -plugin/deploy/ \ No newline at end of file +plugin/deploy/ +#ignore track container file +client/trackcontianers/ \ No newline at end of file diff --git a/client/trackcontainers.go b/client/trackcontainers.go new file mode 100644 index 0000000..da13c8e --- /dev/null +++ b/client/trackcontainers.go @@ -0,0 +1 @@ +package client diff --git a/client/trackcontainers/.gitkeep b/client/trackcontainers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/client/trackcontianers.json b/client/trackcontianers.json new file mode 100644 index 0000000..e69de29 diff --git a/config/config.go b/config/config.go index 9ce4789..94af912 100644 --- a/config/config.go +++ b/config/config.go @@ -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"