mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
general-functions.pl: Do not die if no red interface could be determined.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
74659290e9
commit
47b2640d37
@@ -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() {
|
||||
my $interface;
|
||||
my $red_iface_file = "${General::swroot}/red/iface";
|
||||
|
||||
open(IFACE, "${General::swroot}/red/iface") or die "Could not open /var/ipfire/red/iface";
|
||||
|
||||
my $interface = <IFACE>;
|
||||
close(IFACE);
|
||||
chomp $interface;
|
||||
if (-e $red_iface_file) {
|
||||
open(IFACE, "$red_iface_file") or die "Could not open $red_iface_file";
|
||||
$interface = <IFACE>;
|
||||
close(IFACE);
|
||||
chomp $interface;
|
||||
}
|
||||
|
||||
return $interface;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user