mirror of
https://git.baguette.netlib.re/Baguette/networkctl
synced 2024-12-18 13:03:30 +00:00
Improved output.
This commit is contained in:
parent
e45da83235
commit
ec6b9f4c29
31
src/main.cr
31
src/main.cr
@ -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|
|
||||
|
Loading…
Reference in New Issue
Block a user