general-functions.pl: Return unique list of nameservers

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
Arne Fitzenreiter
2020-01-30 13:13:46 +01:00
parent 99cadb743a
commit e8adbea97b

View File

@@ -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;