diff --git a/html/cgi-bin/traffic.cgi b/html/cgi-bin/traffic.cgi index 2f28537d0..67cea7c2e 100644 --- a/html/cgi-bin/traffic.cgi +++ b/html/cgi-bin/traffic.cgi @@ -55,12 +55,12 @@ display_vnstat($netsettings{'GREEN_DEV'}); # Display external network / check if it is PPP or ETH # and dont display if RED_DEV=GREEN_DEV (green only mode) -if ($netsettings{'RED_TYPE'} ne 'PPPOE') { - if ($netsettings{'RED_DEV'} ne $netsettings{'GREEN_DEV'}) { - display_vnstat($netsettings{'RED_DEV'}); - } -} else { - display_vnstat("ppp0"); +if ($netsettings{'RED_DEV'} ne $netsettings{'GREEN_DEV'}) { + # Omit the red interface name. + my $red_iface = &General::get_red_interface(); + + # Display the red stats if a device could be grabbed. + display_vnstat($red_iface) if ($red_iface); } # Check config and display aditional Networks (BLUE and ORANGE)