Skip to content

Commit

Permalink
Merge pull request #317 from gravitl/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
0xdcarns authored Oct 4, 2021
2 parents bb3172e + 894bb58 commit f30fb3b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions serverctl/serverctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f30fb3b

Please sign in to comment.