]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - rpc/dial.go
remote: add "sync" sub-command to perform changes
[safcm/safcm.git] / rpc / dial.go
index 36092793e005e06991a64fe440b97ca74fac6a88..db25cb7b6e823ab5287e039304a31a46c5483ab3 100644 (file)
@@ -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)
@@ -276,6 +280,8 @@ func connGetGoarch(stdin io.Writer, stdout *bufio.Reader) (string, error) {
        switch x {
        case "x86_64":
                goarch = "amd64"
+       case "armv7l":
+               goarch = "armv7l"
        default:
                return "", fmt.Errorf("unsupported arch %q (`uname -m`)", x)
        }