Rearrange files
This commit is contained in:
17
bin/kutu-run.rb
Executable file
17
bin/kutu-run.rb
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require "socket"
|
||||
|
||||
SOCK_PATH = "/tmp/kutu.sock"
|
||||
|
||||
cli_addr_path = "/tmp/kutu_client#{Process.pid}.sock"
|
||||
File.delete cli_addr_path if File.exist? cli_addr_path
|
||||
|
||||
client = Socket.new :UNIX, :DGRAM
|
||||
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