From patchwork Thu Aug 5 21:01:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 4612 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Ggh10637Rz3xGN for ; Thu, 5 Aug 2021 21:03:48 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Ggh103RlYz27s; Thu, 5 Aug 2021 21:03:48 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Ggh102r30z2xs0; Thu, 5 Aug 2021 21:03:48 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Ggh0y5H6Vz2xKH for ; Thu, 5 Aug 2021 21:03:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Ggh0y2pfNzs6; Thu, 5 Aug 2021 21:03:46 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1628197426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D7/Juz/SUtNNww/XxQa31UERjPdpZXGiuRmAmMrXUrg=; b=3N93h7BMWTfGCif85mj01Ux0NngQXpHnv3qcs01uFI4fUsao9mZDpsFwq3h2/svBj8uwFI 8CEho6t7RankctBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1628197426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D7/Juz/SUtNNww/XxQa31UERjPdpZXGiuRmAmMrXUrg=; b=jOgqumzzRSfFunThm8AbIQFIpx73AB2n8a23jLa2Ufs11IXw/86mO9VVPj1AZOKNlJAOaz y7QbuLWSEL+hY2IZLop71QuRF5L9KglUjjgWRZmrCDbccDg6yYwQf61hF56yspccEgKiwd T80P2a93g2xtk/hXKJRbFaDD1G1hCs5HyqmbvPVtgAM/do7JpgfMdGh4aoxCnfU9+2Kox6 V5Vp86oKdmpk+OvFLhUM2yGP2Vk3W1dzzYqz77Y55WuKGKyl7XMvz9SJCgpQk58JYo4vzN zxljSBkIW0O3Pq1UiG6c1WBo+DhF1QUeFMhOmw3V/i3f2vO9Ocgq5F/sT6eLvg== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH v4 8/8] wlanap.cgi: Access db.txt in place of using regdbdump on regulatory.bin Date: Thu, 5 Aug 2021 23:01:52 +0200 Message-Id: <20210805210152.3467498-8-adolf.belka@ipfire.org> In-Reply-To: <20210805210152.3467498-1-adolf.belka@ipfire.org> References: <20210805210152.3467498-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - wlanap.cgi was using regdbdump from crda to create a text based list of the wireless settings by country database. - With the removal of crda as part of the removal of python2 this option could not be used. - wireless-regdb also has a text based database list in the source tarball and this patch makes wlanap.cgi read this list into the @countrylist_cmd variable - This needs to be tested by someone that has an IPFire system with wifi that can access and evaluate wlanap.cgi to confirm that this change functions as expected. - This version changes the name of the stored text file from db.txt to regulatorydb.txt - The command to read the data from regulatorydb.txt into @countrylist_cmd has been corrected Signed-off-by: Adolf Belka Reviewed-by: Bernhard Bitsch --- html/cgi-bin/wlanap.cgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/wlanap.cgi b/html/cgi-bin/wlanap.cgi index eba5fe774..5eb34d651 100644 --- a/html/cgi-bin/wlanap.cgi +++ b/html/cgi-bin/wlanap.cgi @@ -312,8 +312,11 @@ if ( $channel =~ /\d+/ ){push(@temp,$channel + 0);} push(@channellist, @temp); } -my @countrylist_cmd = `regdbdump /usr/lib/crda/regulatory.bin 2>/dev/null`; # get available country codes +open(FILE, “; +close(FILE); + my @temp = "00"; foreach (@countrylist_cmd){