21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/event_store/http/connect/controls/ip_address/loopback/alias.rb', line 21
def self.call
port = Port::Unused.get
unaliased_ip_addresses = list.select do |ip_address|
begin
server = TCPServer.new ip_address, port
server.close
false
rescue Errno::EADDRNOTAVAIL
true
end
end
return true if unaliased_ip_addresses.none?
warn <<~MESSAGE
The following loopback aliases are not configured:
#{unaliased_ip_addresses * "\n "}
To setup a loopback alias, run the following command:
sudo ifconfig lo0 alias 127.0.111.1
Note that the above command was tested on OS X and may vary
on Linux systems.
MESSAGE
false
end
|