SR-G / sleep-on-lan

Multi-platform process allowing to sleep on LAN a linux or windows computer, through wake-on-lan (reversed) magic packets or through HTTP REST requests.
Apache License 2.0
332 stars 25 forks source link

Commands cannot execute. I think the Execute function in SR-G/sleep-on-lan/src/utils_system.go is bugged. #56

Open aab641 opened 9 months ago

aab641 commented 9 months ago

I think this may work better.

func Execute(command string) (bool, string, error) { // Use a shell to execute the command out, err := exec.Command("sh", "-c", command).Output() if err != nil { return false, string(out), err } return true, string(out), nil }