mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-23 17:32:57 +02:00
ids-functions.pl: Fix generating of HOME_NET declaration
Fixes #12407. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
5011657a7b
commit
adb320bc4a
@@ -677,22 +677,7 @@ sub generate_home_net_file() {
|
||||
}
|
||||
|
||||
# Format home net declaration.
|
||||
my $line = "\"\[";
|
||||
|
||||
# Loop through the array of networks.
|
||||
foreach my $network (@networks) {
|
||||
# Add the network to the line.
|
||||
$line = "$line" . "$network";
|
||||
|
||||
# Check if the current network was the last in the array.
|
||||
if ($network eq $networks[-1]) {
|
||||
# Close the line.
|
||||
$line = "$line" . "\]\"";
|
||||
} else {
|
||||
# Add "," for the next network.
|
||||
$line = "$line" . "\,";
|
||||
}
|
||||
}
|
||||
my $line = "[" . join(',', @networks) . "]";
|
||||
|
||||
# Open file to store the addresses of the home net.
|
||||
open(FILE, ">$homenet_file") or die "Could not open $homenet_file. $!\n";
|
||||
|
||||
Reference in New Issue
Block a user