small pixel drawing of a pufferfish zoa

whip it good
Jes Olson j3s@c3f.net
Fri, 30 Sep 2022 18:19:37 -0500
commit

6c045dc7444098f19369f13f7c98f039718571a3

parent

cff024cb00455b24f3e8f99ac6f65e6a10ec0d8b

2 files changed, 27 insertions(+), 1 deletions(-)

jump to
M main.gomain.go

@@ -62,7 +62,19 @@ }

} } - err = shell.SSH("sudo zoa https://git.sr.ht/~j3s/testy", hosts) + err = shell.SCP("main", hosts) + if err != nil { + log.Fatal(err) + } + err = shell.SCPDir("scripts", hosts) + if err != nil { + log.Fatal(err) + } + err = shell.SCPDir("files", hosts) + if err != nil { + log.Fatal(err) + } + err = shell.SSH("sudo zoa .", hosts) if err != nil { log.Fatal(err) }
M shell/shell.goshell/shell.go

@@ -187,3 +187,17 @@ return err

} return nil } + +func SCPDir(dir string, hostlist []string) error { + _, err := exec.LookPath("scp") + if err != nil { + log.Fatal(err) + } + for _, server := range hostlist { + cmd := exec.Command("scp", "-r", dir, server+":"+dir) + cmd.Stdout = os.Stdout + err := cmd.Run() + return err + } + return nil +}