1
0
mirror of https://github.com/IceWhaleTech/CasaOS.git synced 2025-07-12 23:50:14 +02:00
* add send notify function

* add shell script

* add system notiry

* remove disk and test common package

* update http status

* add share function to common

* remove temp path

* remove /DATA directory initialization - moved to local-storage (#578)

* update goreleaser configuration

* wip

* change service type to notify for systemd so its status is OK only when service is initialized successfully

* update CasaOS-Common to fix runtime error

* wip

* add send notify function

* add shell script

* add system notiry

* remove disk and test common package

* update http status

* add share function to common

* remove temp path

* remove /DATA directory initialization - moved to local-storage (#578)

* update goreleaser configuration

* wip

* change service type to notify for systemd so its status is OK only when service is initialized successfully

* update CasaOS-Common to fix runtime error

* wip

* wip

* wip

* wip

* wip

* Utilization interface to supplement disk information

* fix upload file

* wip

* wip

* add update url

* wip

* wip

* add change log

* update changelog

Co-authored-by: LinkLeong <a624669980@163.com>
This commit is contained in:
Tiger Wang
2022-10-20 02:25:26 -04:00
committed by GitHub
parent 8cec47e4db
commit 381fb85b1d
57 changed files with 1341 additions and 2370 deletions

View File

@ -35,8 +35,8 @@ func ExecResultStrArray(cmdStr string) []string {
fmt.Println(err)
return nil
}
//str, err := ioutil.ReadAll(stdout)
var networklist = []string{}
// str, err := ioutil.ReadAll(stdout)
networklist := []string{}
outputBuf := bufio.NewReader(stdout)
for {
output, _, err := outputBuf.ReadLine()
@ -54,6 +54,8 @@ func ExecResultStrArray(cmdStr string) []string {
func ExecResultStr(cmdStr string) string {
cmd := exec.Command("/bin/bash", "-c", cmdStr)
println(cmd.String())
stdout, err := cmd.StdoutPipe()
if err != nil {
fmt.Println(err)
@ -73,7 +75,7 @@ func ExecResultStr(cmdStr string) string {
return string(str)
}
//执行 lsblk 命令
// 执行 lsblk 命令
func ExecLSBLK() []byte {
output, err := exec.Command("lsblk", "-O", "-J", "-b").Output()
if err != nil {
@ -83,7 +85,7 @@ func ExecLSBLK() []byte {
return output
}
//执行 lsblk 命令
// 执行 lsblk 命令
func ExecLSBLKByPath(path string) []byte {
output, err := exec.Command("lsblk", path, "-O", "-J", "-b").Output()
if err != nil {
@ -93,7 +95,7 @@ func ExecLSBLKByPath(path string) []byte {
return output
}
//exec smart
// exec smart
func ExecSmartCTLByPath(path string) []byte {
timeout := 3
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
@ -107,6 +109,5 @@ func ExecSmartCTLByPath(path string) []byte {
}
func ExecEnabledSMART(path string) {
exec.Command("smartctl", "-s on", path).Output()
}