Enhance Network Interface Detection and Configuration Management
- Implemented robust network interface detection with `GetInterfaces()` function - Added validation for network interface names using regex patterns - Updated `Network` struct to improve YAML tag formatting - Modified `Gather()` and `SaveConfig()` methods to streamline network configuration - Removed redundant `SaveConfig()` calls in various methods - Added comprehensive network interface name validation logic
This commit is contained in:
@@ -57,12 +57,12 @@ type OS struct {
|
||||
OsType string `yaml:"os_type"`
|
||||
Kernel string `yaml:"kernel"`
|
||||
Arch string `yaml:"arch"`
|
||||
IsUbuntuType bool `yaml:"is_ubuntu_type",comment:"是否是ubuntu类型的操作系统"`
|
||||
PackInit bool `yaml:"pack_init",comment:"是否初始化,ubuntu需要"`
|
||||
IsUbuntuType bool `yaml:"is_ubuntu_type" comment:"是否是ubuntu类型的操作系统"`
|
||||
PackInit bool `yaml:"pack_init" comment:"是否初始化,ubuntu需要"`
|
||||
}
|
||||
|
||||
type Network struct {
|
||||
Internet int `yaml:"internet",comment:"是否能够上网 外网为9 国内为7 不能上网为1"`
|
||||
Internet int `yaml:"internet" comment:"是否能够上网 外网为9 国内为7 不能上网为1"`
|
||||
Public PublicInfo `yaml:"public"`
|
||||
Interfaces []Interface `yaml:"interfaces"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user