Improved output.

This commit is contained in:
Philippe PITTOLI 2019-10-07 01:49:39 +02:00
parent e45da83235
commit ec6b9f4c29

View File

@ -330,13 +330,19 @@ class WirelessAPSetup
str << "\t\tmtu #{mtu}\n" unless mtu.nil?
# ipv4
str << "\t\tinet #{@main_ip_v4}\n"
@aliasses_v4.each do |a|
unless main_ip_v4.is_a?(NotSetup)
str << "\t\tinet #{main_ip_v4}\n"
end
aliasses_v4.each do |a|
str << "\t\talias #{a}\n"
end
# ipv6
str << "\t\tinet6 #{@main_ip_v6}\n"
unless main_ip_v6.is_a?(NotSetup)
str << "\t\tinet6 #{main_ip_v6}\n"
end
unless @aliasses_v6.empty?
@aliasses_v6.each do |a|
str << "\t\talias6 #{a}\n"
@ -417,7 +423,10 @@ class InterfaceConfiguration
end
# ipv4
str << "\tinet #{main_ip_v4}\n"
unless main_ip_v4.is_a?(NotSetup)
str << "\tinet #{main_ip_v4}\n"
end
unless aliasses_v4.empty?
aliasses_v4.each do |a|
str << "\talias #{a}\n"
@ -425,25 +434,23 @@ class InterfaceConfiguration
end
# ipv6
str << "\tinet6 #{main_ip_v6}\n"
unless main_ip_v6.is_a?(NotSetup)
str << "\tinet6 #{main_ip_v6}\n"
end
unless aliasses_v6.empty?
aliasses_v6.each do |a|
str << "\talias6 #{a}\n"
end
end
if dns.empty?
str << "\tno dns configured\n"
else
unless dns.empty?
dns.each do |ip|
str << "\tdns: #{ip}\n"
end
end
if wireless_networks.empty?
str << "\tno wireless connection configured\n" if wireless
else
unless wireless_networks.empty?
# to improve readability
str << "\n"
wireless_networks.each do |k,v|