From d52d1c7ae62bb5834ae5bbd0ccbf6e87f5eb7ffb Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 15 Dec 2023 20:20:20 +0100 Subject: yeye --- c_josh.go | 15 ++++++++++++++- josh | Bin 0 -> 2924784 bytes 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 josh diff --git a/c_josh.go b/c_josh.go index 3cbcae4..2cd6c01 100644 --- a/c_josh.go +++ b/c_josh.go @@ -47,7 +47,12 @@ package main -import "fmt" +import ( + "fmt" + "os" + "os/exec" + "strconv" +) func display_servers(lhost *HostList) { curr := lhost.head @@ -55,6 +60,14 @@ func display_servers(lhost *HostList) { fmt.Println(curr.ID, curr.Folder + curr.Name) curr = curr.next } + fmt.Println() + curr = lhost.head + fmt.Println ("ssh", "-i", curr.Priv, "-p", strconv.Itoa(int(curr.Port)), curr.User + "@" + curr.Host) + cmd := exec.Command("ssh", "-i", curr.Priv, "-p", strconv.Itoa(int(curr.Port)), curr.User + "@" + curr.Host) + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + cmd.Run() } func main() { diff --git a/josh b/josh new file mode 100755 index 0000000..91cb381 Binary files /dev/null and b/josh differ -- cgit v1.2.3