minor adjustments

This commit is contained in:
seriousm4x
2023-12-14 01:09:30 +01:00
parent 6c6fd561e6
commit 3331ae96f5
3 changed files with 3 additions and 7 deletions

View File

@@ -47,11 +47,7 @@ func PingDevice(device *models.Record) bool {
cmd := exec.Command(shell, shell_arg, ping_cmd)
err := cmd.Run()
if err != nil {
return false
}
return true
return err == nil
}
}

View File

@@ -14,9 +14,9 @@ import (
func WakeDevice(device *models.Record) error {
logger.Info.Println("Wake triggered for", device.GetString("name"))
wake_cmd := device.GetString("wake_cmd")
if wake_cmd != "" {
var shell string
var shell_arg string
if runtime.GOOS == "windows" {

View File

@@ -6,9 +6,9 @@ export type Device = RecordModel & {
mac: string;
netmask: string;
status: 'pending' | 'online' | 'offline' | '';
ping_cmd: string;
ports: string[];
link: URL;
ping_cmd: string;
wake_cron: string;
wake_cron_enabled: boolean;
wake_cmd: string;