diff options
author | Joe <rbo@gmx.us> | 2023-12-27 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2023-12-27 20:20:20 +0100 |
commit | d1e2afc6e969fc647394959f03ae0b867385d1a1 (patch) | |
tree | 6c3a81a10b34f05f1fb558eb6481bd5a46c76283 /c_exec.go | |
parent | notmuch (diff) | |
download | hardflip-d1e2afc6e969fc647394959f03ae0b867385d1a1.tar.gz hardflip-d1e2afc6e969fc647394959f03ae0b867385d1a1.tar.bz2 hardflip-d1e2afc6e969fc647394959f03ae0b867385d1a1.tar.xz hardflip-d1e2afc6e969fc647394959f03ae0b867385d1a1.tar.zst hardflip-d1e2afc6e969fc647394959f03ae0b867385d1a1.zip |
aint easy
Diffstat (limited to '')
-rw-r--r-- | c_exec.go | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -128,26 +128,23 @@ func c_format_rdp(host *HostNode) []string { return cmd_fmt } -func c_format_cmd(dir_id, host_id uint64, ldirs *DirsList) { +func c_format_cmd(host *HostNode) { var cmd_fmt []string - host := ldirs.sel(dir_id).lhost.sel(host_id) - if host == nil { - c_die("host id not found", nil) - } - if host.Protocol == 0 { + switch host.Protocol { + case 0: cmd_fmt = c_format_ssh(host) - } else if host.Protocol == 1 { + case 1: cmd_fmt = c_format_rdp(host) - } else if host.Protocol > 1 { + default: c_die("type not found", nil) } c_exec_cmd(cmd_fmt) } -func c_exec(dir_id, host_id uint64, ldirs *DirsList) { - if ldirs.head == nil { +func c_exec(host *HostNode) { + if host == nil { return } - c_format_cmd(dir_id, host_id, ldirs) + c_format_cmd(host) } |