2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-07 00:57:30 +08:00
Files
panel/packages/helpers/os.go
2023-06-23 04:20:57 +08:00

24 lines
388 B
Go

package helpers
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"
}