🎨配置文件的初始化

This commit is contained in:
coward
2024-03-07 17:32:38 +08:00
parent 28cdfd1240
commit 15cfa17a5e
12 changed files with 228 additions and 33 deletions

View File

@@ -5,6 +5,7 @@ import (
"gitee.ltd/lxh/logger/log"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"wireguard-dashboard/client"
"wireguard-dashboard/component"
"wireguard-dashboard/constant"
"wireguard-dashboard/model/entity"
"wireguard-dashboard/repository"
@@ -143,5 +144,13 @@ func (s Script) InitServer() error {
return err
}
// 数据库保存完毕,应用配置到配置文件当中
err = component.Wireguard().Apply("E:\\Workspace\\Go\\wireguard-dashboard\\template\\wg.conf",
"E:\\Workspace\\Go\\wireguard-dashboard\\wg0.conf", nil)
if err != nil {
log.Errorf("应用配置文件失败: %v", err.Error())
return err
}
return nil
}