2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 20:57:19 +08:00
Files
panel/pkg/tools/os.go
2023-10-02 16:32:05 +08:00

24 lines
415 B
Go

package tools
import (
"os"
"runtime"
)
// IsDebian 判断是否是 Debian 系统
func IsDebian() bool {
_, err := os.Stat("/etc/debian_version")
return err == nil
}
// IsRHEL 判断是否是 RHEL 系统
func IsRHEL() bool {
_, err := os.Stat("/etc/redhat-release")
return err == nil
}
// IsArm 判断是否是 ARM 架构
func IsArm() bool {
return runtime.GOARCH == "arm" || runtime.GOARCH == "arm64"
}