Browse Source

Merge pull request #316 from gravitl/hotfix_v0.8.2_slash

Hotfix v0.8.2 slash
dcarns 3 years ago
parent
commit
894bb5809c
2 changed files with 9 additions and 5 deletions
  1. 0 1
      README.md
  2. 9 4
      serverctl/serverctl.go

+ 0 - 1
README.md

@@ -49,5 +49,4 @@ After installing Netmaker, check out the [Walkthrough](https://itnext.io/getting
  [WireGuard](https://wireguard.com/) is a registered trademark of Jason A. Donenfeld.
 
 ## License
-
 Netmaker's source code and all artifacts in this repository are freely available. All versions are published under the Server Side Public License (SSPL), version 1, which can be found here: [LICENSE.txt](./LICENSE.txt).

+ 9 - 4
serverctl/serverctl.go

@@ -33,15 +33,20 @@ func GetServerWGConf() (models.IntClient, error) {
 func InstallNetclient() error {
 
 	netclientPath := ncutils.GetNetclientPath()
+	if ncutils.IsWindows() {
+		netclientPath += "\\"
+	} else {
+		netclientPath += "/"
+	}
 	if !FileExists(netclientPath + "netclient") {
 		var err error
 		if ncutils.IsWindows() {
-			_, err = copy(".\\netclient\\netclient", netclientPath+"\\netclient")
+			_, err = copy(".\\netclient\\netclient", netclientPath+"netclient")
 		} else {
-			_, err = copy("./netclient/netclient", netclientPath+"/netclient")
+			_, err = copy("./netclient/netclient", netclientPath+"netclient")
 		}
 		if err != nil {
-			log.Println("could not create " + netclientPath + "/netclient")
+			log.Println("could not create " + netclientPath + "netclient")
 			return err
 		}
 	}
@@ -102,7 +107,7 @@ func RemoveNetwork(network string) (bool, error) {
 
 func InitServerNetclient() error {
 	netclientDir := ncutils.GetNetclientPath()
-	_, err := os.Stat(netclientDir+"/config")
+	_, err := os.Stat(netclientDir + "/config")
 	if os.IsNotExist(err) {
 		os.MkdirAll(netclientDir+"/config", 744)
 	} else if err != nil {