From e8adbea97beb1107a48b3f804143e11ebf6228bb Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Thu, 30 Jan 2020 13:13:46 +0100 Subject: [PATCH] general-functions.pl: Return unique list of nameservers Signed-off-by: Arne Fitzenreiter --- config/cfgroot/general-functions.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 448f4c6355..41a0eac2d4 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -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; -- 2.39.2