From fa4988c84700d0a09b0c96634e2290c510492620 Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Tue, 7 May 2024 07:51:58 +0000 Subject: [PATCH] update --- README.md | 6 +++++- basics_install.sh | 34 +++++++++++++++++----------------- cmd/main.go | 14 ++++++++++++-- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index c85bafc..083957a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,11 @@ [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Foneclickvirt%2Fbasics&count_bg=%232EFFF8&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com) [![Build and Release](https://github.com/oneclickvirt/basics/actions/workflows/main.yaml/badge.svg)](https://github.com/oneclickvirt/basics/actions/workflows/main.yaml) -系统基础信息查询模块 +系统基础信息查询模块 (System Basic Information Query Module) + +## Information + +Use ```-l``` to specify the output language, currently ```en``` and ```zh``` are supported. ## Usage diff --git a/basics_install.sh b/basics_install.sh index 048571b..a42439e 100644 --- a/basics_install.sh +++ b/basics_install.sh @@ -58,23 +58,23 @@ case $os in ;; esac ;; - OpenBSD) - case $arch in - amd64) - wget -O basics https://github.com/oneclickvirt/basics/releases/download/output/basics-openbsd-amd64 - ;; - "i386" | "i686") - wget -O basics https://github.com/oneclickvirt/basics/releases/download/output/basics-openbsd-386 - ;; - "armv7l" | "armv8" | "armv8l" | "aarch64") - wget -O basics https://github.com/oneclickvirt/basics/releases/download/output/basics-openbsd-arm64 - ;; - *) - echo "Unsupported architecture: $arch" - exit 1 - ;; - esac - ;; + # OpenBSD) + # case $arch in + # amd64) + # wget -O basics https://github.com/oneclickvirt/basics/releases/download/output/basics-openbsd-amd64 + # ;; + # "i386" | "i686") + # wget -O basics https://github.com/oneclickvirt/basics/releases/download/output/basics-openbsd-386 + # ;; + # "armv7l" | "armv8" | "armv8l" | "aarch64") + # wget -O basics https://github.com/oneclickvirt/basics/releases/download/output/basics-openbsd-arm64 + # ;; + # *) + # echo "Unsupported architecture: $arch" + # exit 1 + # ;; + # esac + # ;; *) echo "Unsupported operating system: $os" exit 1 diff --git a/cmd/main.go b/cmd/main.go index f1cafce..e633fb8 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -1,6 +1,7 @@ package main import ( + "flag" "fmt" "net/http" "strings" @@ -10,12 +11,21 @@ import ( ) func main() { + languagePtr := flag.String("l", "", "Language parameter (en or zh)") + flag.Parse() + var language string + if *languagePtr == "" { + language = "zh" + } else { + language = *languagePtr + } + language = strings.ToLower(language) go func() { http.Get("https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Foneclickvirt%2Fbasics&count_bg=%232EFFF8&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false") }() fmt.Println("项目地址:", "https://github.com/oneclickvirt/basics") - ipInfo, _, _ := network.NetworkCheck("both", false, "zh") - res := system.CheckSystemInfo("zh") + ipInfo, _, _ := network.NetworkCheck("both", false, language) + res := system.CheckSystemInfo(language) fmt.Println("--------------------------------------------------") fmt.Printf(strings.ReplaceAll(res+ipInfo, "\n\n", "\n")) fmt.Println("--------------------------------------------------")