mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 02:55:55 +02:00
general-functions.pl: Return unique list of nameservers
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
@@ -29,6 +29,9 @@ $General::adminmanualurl = 'http://wiki.ipfire.org';
|
||||
|
||||
require "${General::swroot}/network-functions.pl";
|
||||
|
||||
# Function to remove duplicates from an array
|
||||
sub uniq { my %seen; grep !$seen{$_}++, @_ }
|
||||
|
||||
#
|
||||
# log ("message") use default 'ipcop' tag
|
||||
# log ("tag","message") use your tag
|
||||
@@ -1255,7 +1258,7 @@ sub get_nameservers () {
|
||||
}
|
||||
|
||||
# Return the array.
|
||||
return @nameservers;
|
||||
return &uniq(@nameservers);
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user