updated ioutil refs and composes

This commit is contained in:
0xdcarns
2022-01-06 15:05:38 -05:00
parent 1387dbee4c
commit 43b9e73eaa
26 changed files with 58 additions and 62 deletions

View File

@@ -3,7 +3,6 @@ package logic
import (
"errors"
"fmt"
"io/ioutil"
"os"
"os/exec"
"strconv"
@@ -89,7 +88,7 @@ func initWireguard(node *models.Node, privkey string, peers []wgtypes.PeerConfig
newConf, _ = ncutils.CreateWireGuardConf(node, key.String(), strconv.FormatInt(int64(node.ListenPort), 10), peers)
confPath := ncutils.GetNetclientPathSpecific() + ifacename + ".conf"
logger.Log(1, "writing wg conf file to:", confPath)
err = ioutil.WriteFile(confPath, []byte(newConf), 0644)
err = os.WriteFile(confPath, []byte(newConf), 0644)
if err != nil {
logger.Log(1, "error writing wg conf file to", confPath, ":", err.Error())
return err
@@ -97,7 +96,7 @@ func initWireguard(node *models.Node, privkey string, peers []wgtypes.PeerConfig
if ncutils.IsWindows() {
wgConfPath := ncutils.GetWGPathSpecific() + ifacename + ".conf"
logger.Log(1, "writing wg conf file to:", confPath)
err = ioutil.WriteFile(wgConfPath, []byte(newConf), 0644)
err = os.WriteFile(wgConfPath, []byte(newConf), 0644)
if err != nil {
logger.Log(1, "error writing wg conf file to", wgConfPath, ":", err.Error())
return err