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 #ignore generated iptables
p2p/iptable/ p2p/iptable/
#ignore plugins added #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 { type Config struct {
IPTable string IPTable string
DockerContainers string DockerContainers string
DefaultDockerFile string DefaultDockerFile string
SpeedTestFile string SpeedTestFile string
IPV6Address string IPV6Address string
PluginPath string PluginPath string
TrackContainersPath string
//NetworkInterface string //NetworkInterface string
//NetworkInterfaceIPV6Index int //NetworkInterfaceIPV6Index int
} }
@@ -74,12 +75,18 @@ func SetDefaults() error {
//Setting current directory to default path //Setting current directory to default path
defaultPath = curDir + "/" 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") err := Copy("p2p/ip_table.json","p2p/iptable/ip_table.json")
if err != nil { if err != nil {
return err 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 //Setting default paths for the config file
defaults["IPTable"] = defaultPath + "p2p/iptable/ip_table.json" defaults["IPTable"] = defaultPath + "p2p/iptable/ip_table.json"
@@ -88,6 +95,7 @@ func SetDefaults() error {
defaults["SpeedTestFile"] = defaultPath + "p2p/50.bin" defaults["SpeedTestFile"] = defaultPath + "p2p/50.bin"
defaults["IPV6Address"] = "" defaults["IPV6Address"] = ""
defaults["PluginPath"] = defaultPath + "plugin/deploy" defaults["PluginPath"] = defaultPath + "plugin/deploy"
defaults["TrackContainersPath"] = defaultPath + "client/trackcontainers/trackcontainers.json"
//defaults["NetworkInterface"] = "wlp0s20f3" //defaults["NetworkInterface"] = "wlp0s20f3"
//defaults["NetworkInterfaceIPV6Index"] = "2" //defaults["NetworkInterfaceIPV6Index"] = "2"