freebsd join, checkin, and leave functional

This commit is contained in:
afeiszli
2021-11-09 23:44:39 +00:00
parent 317a639bf5
commit c4303d2499
4 changed files with 35 additions and 7 deletions

View File

@@ -2,7 +2,6 @@ package wireguard
import (
"io/ioutil"
"github.com/gravitl/netmaker/models"
"github.com/gravitl/netmaker/netclient/config"
"github.com/gravitl/netmaker/netclient/ncutils"
@@ -50,7 +49,8 @@ func SetWGKeyConfig(network string, serveraddr string) error {
// ApplyWGQuickConf - applies wg-quick commands if os supports
func ApplyWGQuickConf(confPath string) error {
if _, err := ncutils.RunCmd("wg-quick up "+confPath, true); err != nil {
_, _ = ncutils.RunCmd("wg-quick down "+confPath, false)
if _, err := ncutils.RunCmd("wg-quick up "+confPath, false); err != nil {
return err
}
return nil