Enhance Zsh and Config Commands, Update Network Configuration

- Implemented comprehensive Zsh installation command with multiple network scenarios
- Added 'config show' subcommand to display agent configuration
- Updated version command to print version information
- Modified Network configuration to clarify internet connectivity status
- Improved download utility with additional file existence checks
- Updated agent-wdd rules and documentation
This commit is contained in:
zeaslity
2025-02-27 14:20:05 +08:00
parent 16c041e3eb
commit 72bc56b5e5
8 changed files with 196 additions and 39 deletions

View File

@@ -39,25 +39,9 @@ func (network *Network) Gather() {
//获取本机网卡相关的内容
}
// CanConnectInternet 判定主机能够上网
// CanConnectInternet 判定主机能够上网 外网为9 国内为7 不能上网为1
func CanConnectInternet() int {
// 初始化 ConfigCache
if ConfigCache == nil {
ConfigCache = &Config{
TimeStamp: "",
ModifiedTimes: 0,
Agent: Agent{
OS: OS{},
Network: Network{},
CPU: CPU{},
Mem: Memory{},
Swap: Swap{},
Disks: []Disk{},
},
}
}
// 读取 config 文件,判定能否上网
internetCode := ConfigCache.Agent.Network.Internet