From 0ba6966e4c2880b589d5c7ad57e34243f30282b9 Mon Sep 17 00:00:00 2001 From: Racks Rask <82312571+furrofurry@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:21:24 +0000 Subject: [PATCH 1/5] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index eb76d5b..072b14b 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,6 @@ sudo cp contrib/asngecko-completion.bash /etc/bash_completion.d/ --- ---- - ## πŸ“œ License Licensed under the MIT License – see [LICENSE](LICENSE) for details. From 5e1baef8d082eefce29efff5d3684b2c3b15a86c Mon Sep 17 00:00:00 2001 From: Racks Rask <82312571+furrofurry@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:23:41 +0000 Subject: [PATCH 2/5] Update asngecko --- asngecko | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asngecko b/asngecko index 79090cf..6494363 100644 --- a/asngecko +++ b/asngecko @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- # asngecko – Swiss-army script for fetching IPv4 / IPv6 prefixes for ASNs # ----------------------------------------------------------------------------- -# Author: +# Author: Racks Rask # License: MIT # ----------------------------------------------------------------------------- # FEATURES From ed9aed937e1e171202c046b7ec1c14d49a97ec0b Mon Sep 17 00:00:00 2001 From: Racks Rask <82312571+furrofurry@users.noreply.github.com> Date: Thu, 12 Jun 2025 08:01:56 +0000 Subject: [PATCH 3/5] yay --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 072b14b..d36db32 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ asngecko -a "AS15169 AS32934" -46 \ ### Arch Linux / Manjaro ```bash -sudo pacman -S asngecko +yay -S asngecko ``` ### Manual From 47f424803b53abb3dec7cdf3a295e1b04d576105 Mon Sep 17 00:00:00 2001 From: furrofurry Date: Thu, 12 Jun 2025 10:19:56 +0200 Subject: [PATCH 4/5] Update asngecko --- asngecko | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/asngecko b/asngecko index 6494363..0cab122 100644 --- a/asngecko +++ b/asngecko @@ -39,7 +39,6 @@ THROTTLE=0 ASN_INPUT=() ASN_FILE="" -# ──────────────────────────────────────────────────────────────────────────────── print_msg() { $QUIET || echo "$*" >&2; } usage() { @@ -49,7 +48,6 @@ $SCRIPT_NAME $VERSION – fetch IP ranges for Autonomous Systems Usage: $SCRIPT_NAME -a AS15169 [options] $SCRIPT_NAME -a "AS15169 AS16509" [options] - $SCRIPT_NAME -a AS15169 -q [more options] | your-special-command $SCRIPT_NAME -l list.txt [options] Options: @@ -141,6 +139,15 @@ ASN_INPUT=("${NORMALISED[@]}") print_msg "ASNs: ${ASN_INPUT[*]}" print_msg "IP family: $IP_VERSION" +# If you only gave --output4 (or only --output6), restrict to that family +if [[ "$OUTPUT_DEST" == "file" ]]; then + if [[ -n "$OUTPUT_FILE_V4" && -z "$OUTPUT_FILE_V6" ]]; then + IP_VERSION="4" + elif [[ -n "$OUTPUT_FILE_V6" && -z "$OUTPUT_FILE_V4" ]]; then + IP_VERSION="6" + fi +fi + # ──────────────────────────────────────────────────────────────────────────────── # Fetch helpers fetch_prefixes() { @@ -190,9 +197,8 @@ format_json() { # Decide where to write & actually write write_output() { local content="$1" fam="$2" - - # Resolve file path when saving local file="" + case "$fam" in v4) file="$OUTPUT_FILE_V4" ;; v6) file="$OUTPUT_FILE_V6" ;; From 654efe870d2e7350e3fbb8d1b29291f02d7b3f9b Mon Sep 17 00:00:00 2001 From: Racks Rask <82312571+furrofurry@users.noreply.github.com> Date: Thu, 12 Jun 2025 08:26:40 +0000 Subject: [PATCH 5/5] added description --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d36db32..9372165 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ > Quickly fetch & format IPv4/IPv6 prefix lists for one‑or‑many Autonomous Systems (ASNs). Awesome customizable tool for retrieving registered IPs attached to ASN systems, enabling easy management, listing, filtering, and automation to your needs. +This can resolve ASNs in batch, and also supports custom timeout between requests, avoiding spam. ---