From: Stefan Schantl Date: Wed, 9 Mar 2022 14:12:32 +0000 (+0100) Subject: general-functions.pl: Do not die if no red interface could be determined. X-Git-Tag: v2.27-core165~15^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47b2640d3766786a12864fb295d41a20eaaa850e;p=ipfire-2.x.git general-functions.pl: Do not die if no red interface could be determined. Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 5118a9d69c..6f49585dc6 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1228,12 +1228,15 @@ sub firewall_reload() { # Function which will return the used interface for the red network zone (red0, ppp0, etc). # if you change this also check speed.cgi that include a local copy for systemload reasons sub get_red_interface() { - - open(IFACE, "${General::swroot}/red/iface") or die "Could not open /var/ipfire/red/iface"; - - my $interface = ; - close(IFACE); - chomp $interface; + my $interface; + my $red_iface_file = "${General::swroot}/red/iface"; + + if (-e $red_iface_file) { + open(IFACE, "$red_iface_file") or die "Could not open $red_iface_file"; + $interface = ; + close(IFACE); + chomp $interface; + } return $interface; }