Merge pull request #475 from m45t3r/next_if_down
network: add next_if_down option
This commit is contained in:
commit
bbbaded77e
@ -286,6 +286,7 @@ class Network(IntervalModule, ColorRangeModule):
|
|||||||
("round_size", "defines number of digits in round"),
|
("round_size", "defines number of digits in round"),
|
||||||
("detached_down", "If the interface doesn't exist, display it as if it were down"),
|
("detached_down", "If the interface doesn't exist, display it as if it were down"),
|
||||||
("unknown_up", "If the interface is in unknown state, display it as if it were up"),
|
("unknown_up", "If the interface is in unknown state, display it as if it were up"),
|
||||||
|
("next_if_down", "Change to next interface if current one is down"),
|
||||||
)
|
)
|
||||||
|
|
||||||
interval = 1
|
interval = 1
|
||||||
@ -302,6 +303,7 @@ class Network(IntervalModule, ColorRangeModule):
|
|||||||
recv_limit = 2048
|
recv_limit = 2048
|
||||||
sent_limit = 1024
|
sent_limit = 1024
|
||||||
separate_color = False
|
separate_color = False
|
||||||
|
next_if_down = False
|
||||||
|
|
||||||
# Network traffic settings
|
# Network traffic settings
|
||||||
divisor = 1024
|
divisor = 1024
|
||||||
@ -409,6 +411,8 @@ class Network(IntervalModule, ColorRangeModule):
|
|||||||
else:
|
else:
|
||||||
color = self.color_down
|
color = self.color_down
|
||||||
format_str = self.format_down
|
format_str = self.format_down
|
||||||
|
if self.next_if_down:
|
||||||
|
self.cycle_interface()
|
||||||
|
|
||||||
network_info = self.network_info.get_info(self.interface)
|
network_info = self.network_info.get_info(self.interface)
|
||||||
format_values.update(network_info)
|
format_values.update(network_info)
|
||||||
|
Loading…
Reference in New Issue
Block a user