Add remote commands support
This commit is contained in:
17
kutu-run.rb
Executable file
17
kutu-run.rb
Executable 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
|
||||
Reference in New Issue
Block a user