Add remote commands support

This commit is contained in:
2025-10-29 17:27:23 +00:00
parent 11806119df
commit a21e716475
13 changed files with 238 additions and 115 deletions

17
kutu-run.rb Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env ruby
require "socket"
SOCK_PATH = "/tmp/kutu.sock"
client = Socket.new(:UNIX, :DGRAM)
cli_addr_path = "/tmp/kutu_client#{Process.pid}.sock"
File.delete(cli_addr_path) if File.exist?(cli_addr_path)
client.bind(Socket.pack_sockaddr_un(cli_addr_path))
client.send(ARGV.join(" "), 0, Socket.pack_sockaddr_un(SOCK_PATH))
data, = client.recvfrom(1024)
puts data