Skip to content

Commit b507896

Browse files
authored
fix: allow arduino to set hostname (#608)
1 parent f86a22f commit b507896

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/board/board.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ func SetCustomName(ctx context.Context, conn remote.RemoteConn, name string) err
201201
return fmt.Errorf("invalid custom name: %s, must match regex %s", name, customNameRegex.String())
202202
}
203203

204-
if err := conn.WriteFile(strings.NewReader(name), "/etc/hostname"); err != nil {
204+
err := conn.GetCmd("sudo", "hostnamectl", "set-hostname", name).
205+
Run(ctx)
206+
if err != nil {
205207
return fmt.Errorf("failed to set board name: %w", err)
206208
}
207209
return nil

0 commit comments

Comments
 (0)