From patchwork Mon Oct 14 14:47:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Weismueller X-Patchwork-Id: 2497 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 "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 46sLyV0TLVz42jH for ; Mon, 14 Oct 2019 14:48:02 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 46sLyR4g7jz1jh; Mon, 14 Oct 2019 14:47:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 46sLyR3M4yz2yCb; Mon, 14 Oct 2019 14:47:59 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 46sLyQ06FVz2y2r for ; Mon, 14 Oct 2019 14:47:57 +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) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 46sLyP2lhxz1jh; Mon, 14 Oct 2019 14:47:57 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1571064477; 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; bh=6zeDjhSQbVPAFxCuyH3S6CD63AG0cnpL9Nmd/C6AvJc=; b=Us57ayLiBClO3dJvtE/GANhLyjEr8p1qb3kxlq6X05qgd7Cwi5W9IHReyRac+DR+iAY5/c A3HKFiZYi4GJUHBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1571064477; 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; bh=6zeDjhSQbVPAFxCuyH3S6CD63AG0cnpL9Nmd/C6AvJc=; b=RyA+k9KPJwEtlSn4+GjXdxYdsjC5pNJWLO10iTjb06LolqJZf16mPoptNx/vYdbIJ6TVfI 3dZhp+LV727EeaudHIRhoqSR8BaJNIXBp/8iugInF37XH/4Ridtz67MiGa6wq8GV+wXWHy b2k1dnN6AtAqONrH2p9Wnnp5GSnEb3AIGt4gp6AhMxR82jPFIC2r5d6G2A74r7J1xhPSoZ mdjNrD/4xFbEu+uyzF+4K++aLypojPBzktjZ+dOw6IJ9rQfuRW3It90htFQ/Gr5GX2TACF zPDUlUwdWubMTmE77tm+xXhGyoMHL93hhuPylVExJ/0KWsfLkMc3/sCfsr6J2g== From: =?utf-8?q?Daniel_Weism=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH 1/4] xt_geoip_update: Perform cleanup after successful operation Date: Mon, 14 Oct 2019 16:47:53 +0200 Message-Id: <20191014144756.7674-1-daniel.weismueller@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=dweismueller smtp.mailfrom=daniel.weismueller@ipfire.org 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" The temporary files were never being cleaned up after the script has finished compiling the database. Signed-off-by: Daniel Weismüller --- src/scripts/xt_geoip_update | 1 - 1 file changed, 1 deletion(-) diff --git a/src/scripts/xt_geoip_update b/src/scripts/xt_geoip_update index 9ea66e006..f3ba8a52e 100644 --- a/src/scripts/xt_geoip_update +++ b/src/scripts/xt_geoip_update @@ -140,7 +140,6 @@ function main() { # Convert GeoIP2 to lagacy. build_legacy || exit $? - return 0 # Remove temporary files. cleanup || exit $? From patchwork Mon Oct 14 14:47:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Weismueller X-Patchwork-Id: 2496 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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 46sLyT4pCjz3yYL for ; Mon, 14 Oct 2019 14:48:01 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 46sLyS03rYz2lf; Mon, 14 Oct 2019 14:47:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 46sLyR6C3cz2yFb; Mon, 14 Oct 2019 14:47:59 +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 "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 46sLyQ1ZqTz2y4F for ; Mon, 14 Oct 2019 14:47:58 +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) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 46sLyP6qQVz2Qg; Mon, 14 Oct 2019 14:47:57 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1571064478; 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=vkwbS94jAIkJlYvrfWN6XpWO2xYG7XDIbstPL+q4ka4=; b=H6pgvq9ffraZqLAEDlF1V6FK/lPCiJOtm2vYM8bEstg+suLiI+GqgATlNK2m133kqWwb45 /xwsldBUFd+P89Dw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1571064478; 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=vkwbS94jAIkJlYvrfWN6XpWO2xYG7XDIbstPL+q4ka4=; b=bmo+ON4BY/npZs4+mlSqjXRLRti0nIbkntPmjTmndEb1AbPZbyZqyeHK0u421Ke0mtqyPc ST1w3H/lWvfpcRTzgKymexYaMxwnMyS1WI5BMqzmuZTK4/1DKq2CttfwLBa685Aqpg3DDh T+npfGqAPA7lVVWYsPSUSZIbj2/pHw4QX+v2TlUh8EctudyMsgJKYh++HvbwGXYRB6Kc3O 3CYD3ABB0ycDRTJ/KEr9eU1t1LKVQakqbt+KYLqEnyoJyjVF+GFCpplB4gCAyVUHsYiQih MQXTkKy0didWEVU6orAx0p7U2DcnndtgM3NamgKgRy6w2yTkCGRim+/tak2ISQ== From: =?utf-8?q?Daniel_Weism=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH 2/4] xt_geoip_update: Use /var/tmp for temporary data Date: Mon, 14 Oct 2019 16:47:54 +0200 Message-Id: <20191014144756.7674-2-daniel.weismueller@ipfire.org> In-Reply-To: <20191014144756.7674-1-daniel.weismueller@ipfire.org> References: <20191014144756.7674-1-daniel.weismueller@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=dweismueller smtp.mailfrom=daniel.weismueller@ipfire.org 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" Since we have some systems that are restricted to only 2GB of space on /, we need to move this to where we have enough space. Signed-off-by: Daniel Weismüller --- src/scripts/xt_geoip_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/xt_geoip_update b/src/scripts/xt_geoip_update index f3ba8a52e..f633229fb 100644 --- a/src/scripts/xt_geoip_update +++ b/src/scripts/xt_geoip_update @@ -19,7 +19,7 @@ # # ############################################################################### -TMP_PATH=$(mktemp -d) +TMP_PATH=$(mktemp -dp /var/tmp) TMP_FILE=$(mktemp -p $TMP_PATH) SCRIPT_PATH=/usr/local/bin From patchwork Mon Oct 14 14:47:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Weismueller X-Patchwork-Id: 2498 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 "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 46sLyV2Wj5z42jJ for ; Mon, 14 Oct 2019 14:48:02 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 46sLyS31lYz2qW; Mon, 14 Oct 2019 14:48:00 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 46sLyS0hDPz2yf3; Mon, 14 Oct 2019 14:48:00 +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 "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 46sLyQ354Fz2yCf for ; Mon, 14 Oct 2019 14:47:58 +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) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 46sLyQ1TdKz2dF; Mon, 14 Oct 2019 14:47:58 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1571064478; 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=60G0hqKWssxdaBEAg/u23m+/E0Cl7C8iLsj5J6Curng=; b=6Ngng+xVHRw5pfThVBr9tNUlTIt6hGrUQTC6YDow0e3UfGWdXFdig0tGwGDl7WSDyP/XIn 22GnsgYq+0q+yIDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1571064478; 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=60G0hqKWssxdaBEAg/u23m+/E0Cl7C8iLsj5J6Curng=; b=NWv0867uB8IYLH1NwG3CRYYWNbMvxDAjer9QJFQj35cfiosmwbQaDREjLTn8/S2oJQJj05 HR3SIRv7LZP7MTVB6xT5U/8KxZtu7+YVIXHdGzKbLmfPddaXcowJD5GIwySkRvWNZBVTEs KquOIUwlzacoFRnDtlGw/GBxxMKWJPAsQlrY4DEgO4f1uJjE3TTT+qInvioeyLoVEM++Fr arbl1Hm2EnbZqWfAhRZDqGoYrVju2gMeizZBaivec2GvdliPRFMXIeocMIpRmd6wHxt1Rb OXqoHhKtwaWNfTC7JkjfhD7oMjoJqwvfrRmUDI3uXrJR9TTgv7jEg5Ue93x6uQ== From: =?utf-8?q?Daniel_Weism=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH 3/4] xt_geoip_update: Do not create temporary directories again Date: Mon, 14 Oct 2019 16:47:55 +0200 Message-Id: <20191014144756.7674-3-daniel.weismueller@ipfire.org> In-Reply-To: <20191014144756.7674-1-daniel.weismueller@ipfire.org> References: <20191014144756.7674-1-daniel.weismueller@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=dweismueller smtp.mailfrom=daniel.weismueller@ipfire.org 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" These already exist Signed-off-by: Daniel Weismüller --- src/scripts/xt_geoip_update | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/scripts/xt_geoip_update b/src/scripts/xt_geoip_update index f633229fb..6c0b70db0 100644 --- a/src/scripts/xt_geoip_update +++ b/src/scripts/xt_geoip_update @@ -35,9 +35,6 @@ eval $(/usr/local/bin/readhash /var/ipfire/proxy/settings) function download() { echo "Downloading latest GeoIP ruleset..." - # Create temporary directory. - mkdir -pv $TMP_PATH - # Proxy settings. # Check if a proxy should be used. if [[ $UPSTREAM_PROXY ]]; then @@ -84,9 +81,6 @@ function install() { } function build_legacy() { - # Create temporary directory. - mkdir -pv $TMP_PATH - echo "Convert database to legacy GeoIP.dat ..." cat $DB_PATH/GeoLite2-Country-Blocks-IPv4.csv | \ $DB1_PATH/bin/geolite2-to-legacy-csv.sh $DB1_PATH/bin/countryInfo.txt > \ From patchwork Mon Oct 14 14:47:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Weismueller X-Patchwork-Id: 2499 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 "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 46sLyV4fkmz42jK for ; Mon, 14 Oct 2019 14:48:02 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 46sLyS4wYXz2v8; Mon, 14 Oct 2019 14:48:00 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 46sLyS2GZBz2yjy; Mon, 14 Oct 2019 14:48:00 +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 "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 46sLyQ4Xdmz2y4F for ; Mon, 14 Oct 2019 14:47:58 +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) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 46sLyQ30Mkz1jh; Mon, 14 Oct 2019 14:47:58 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1571064478; 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=1hpbXnXLGp28uCE/+hBr9F4AKshFwjqJX6QoH3f2Xq8=; b=AaR7Y7Nhd8UNlEZPPaq6a5H5UqQk7LHPKMYMwqSn+rM96SJoWWeiNDW/TMh9BRWJf9RM1X lVRCUntR/XRwstBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1571064478; 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=1hpbXnXLGp28uCE/+hBr9F4AKshFwjqJX6QoH3f2Xq8=; b=MWZreCTVzoavsK71BwaHmypemSTU0oas2Im3D1fEu2bruxtX/2NEjM7rFRybb6YHXyZ+XM BnDMVBStrddHGAFDezOTnE4jvMGqpZARHdUBAwPDshhZzFbh7Hpw2ja8d7ZOPN9zyD6/8W ZWFXbkRhRy32tSqpYib/RDNeQTEP/epgp8ww+AJ+2xBHdf6/rkH+nvD27MOcq2MtjzKaiK PhvAzOeU43PzMsD1NnhXE/nGMgmv3D7nINRc9QBXrulHApPT9c5JlcGPRGV2AEmL0VskFF g/KUhDncBQJyOvu0S3YoayNUrAeZgBTCzPyNRE1BjwcJU2pxy1eQNt3duj3UPg== From: =?utf-8?q?Daniel_Weism=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH 4/4] xt_geoip_update: Always call the cleanup function when some step fails Date: Mon, 14 Oct 2019 16:47:56 +0200 Message-Id: <20191014144756.7674-4-daniel.weismueller@ipfire.org> In-Reply-To: <20191014144756.7674-1-daniel.weismueller@ipfire.org> References: <20191014144756.7674-1-daniel.weismueller@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=dweismueller smtp.mailfrom=daniel.weismueller@ipfire.org 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" Signed-off-by: Daniel Weismüller --- src/scripts/xt_geoip_update | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/scripts/xt_geoip_update b/src/scripts/xt_geoip_update index 6c0b70db0..ebd266533 100644 --- a/src/scripts/xt_geoip_update +++ b/src/scripts/xt_geoip_update @@ -117,27 +117,22 @@ function cleanup() { } function main() { - # Download ruleset. - download || exit $? + local func + for func in download install build build_legacy; do + if ! ${func}; then + # Cleanup any temporary data + cleanup - if ! install; then - # Do cleanup. - cleanup || exit $? - exit 1 - fi - - # Remove temporary files. - cleanup || exit $? - - # Convert the ruleset. - build || exit $? + return 1 + fi + done - # Convert GeoIP2 to lagacy. - build_legacy || exit $? + # Cleanup + cleanup || return $? - # Remove temporary files. - cleanup || exit $? + # All done + return 0 } # Run the main function. -main +main || exit $?