1
0
mirror of https://github.com/IceWhaleTech/CasaOS.git synced 2025-07-15 23:54:17 +02:00

Fixed issues

This commit is contained in:
link
2022-02-17 18:43:25 +08:00
parent 53335012d8
commit e1a928cd78
34 changed files with 561 additions and 136 deletions

View File

@ -2,6 +2,7 @@ package service
import (
"io/ioutil"
"net"
"os"
"github.com/IceWhaleTech/CasaOS/pkg/config"
@ -71,6 +72,21 @@ func (s *systemService) GetCasaOSLogs(lineNumber int) string {
return string(content)
}
func GetDeviceAllIP() []string {
var address []string
addrs, err := net.InterfaceAddrs()
if err != nil {
return address
}
for _, a := range addrs {
if ipNet, ok := a.(*net.IPNet); ok && !ipNet.IP.IsLoopback() {
if ipNet.IP.To16() != nil {
address = append(address, ipNet.IP.String())
}
}
}
return address
}
func NewSystemService(log loger.OLog) SystemService {
return &systemService{log: log}
}