X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=rpc%2Fdial.go;h=db25cb7b6e823ab5287e039304a31a46c5483ab3;hb=b5e2d93b0bc818bea7f694ac7128c1920d508f43;hp=b723e55c5657e78609d79b8019448636c3de5eef;hpb=ac30b1856db3d63705270ddf26ff0b7b56c9c9c9;p=safcm%2Fsafcm.git diff --git a/rpc/dial.go b/rpc/dial.go index b723e55..db25cb7 100644 --- a/rpc/dial.go +++ b/rpc/dial.go @@ -32,11 +32,15 @@ import ( "ruderich.org/simon/safcm/remote" ) -func (c *Conn) DialSSH(remote string) error { +func (c *Conn) DialSSH(user, host string) error { if c.events == nil { return fmt.Errorf("cannot reuse Conn") } + remote := host + if user != "" { + remote = user + "@" + host + } c.debugf("DialSSH: connecting to %q", remote) opts := "-eu" @@ -148,7 +152,7 @@ f() { chmod 0700 "$x" fi - exec "$x" + exec "$x" sync } f `, path)