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