You've already forked CasaOS
mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-07-15 23:54:17 +02:00
added google drive and dropbox driver
This commit is contained in:
@ -2,14 +2,12 @@ package command
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func OnlyExec(cmdStr string) {
|
||||
@ -98,23 +96,6 @@ func ExecLSBLKByPath(path string) []byte {
|
||||
return output
|
||||
}
|
||||
|
||||
// exec smart
|
||||
func ExecSmartCTLByPath(path string) []byte {
|
||||
timeout := 3
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
|
||||
defer cancel()
|
||||
output, err := exec.CommandContext(ctx, "smartctl", "-a", path, "-j").Output()
|
||||
if err != nil {
|
||||
fmt.Println("smartctl", err)
|
||||
return nil
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
func ExecEnabledSMART(path string) {
|
||||
exec.Command("smartctl", "-s on", path).Output()
|
||||
}
|
||||
|
||||
func ExecuteScripts(scriptDirectory string) {
|
||||
if _, err := os.Stat(scriptDirectory); os.IsNotExist(err) {
|
||||
fmt.Printf("No post-start scripts at %s\n", scriptDirectory)
|
||||
|
Reference in New Issue
Block a user