🎨配置文件的初始化
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user