d

Ruby code posted by d
created at 14 Apr 13:34, updated at 14 Apr 13:36

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env ruby

gateway= "mail.kreatio.in"
dest_ips= [["192.168.2.20", 18021],
           ["192.168.1.52", 18022],
           ["192.168.10.11", 18023],
           ["192.168.1.69", 18024]]

sys_args= [{"AUTOSSH_POLL" => "20"}, ["autossh", "dk-ssh-tunnel"], "-M", "2000"] + dest_ips.map {|a| i,p=a; "-L#{p}:#{i}:22"} + [gateway, "-N"]

system(*sys_args) 

371 Bytes in 3 ms with coderay