diff options
author | Toni <matzeton@googlemail.com> | 2022-05-07 09:33:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-07 09:33:25 +0200 |
commit | b2648a45a377fb891319e59e2aa94729705c6c2a (patch) | |
tree | e64b1518cb06686bf54365861c8028b3c74ab036 /utils/asn_update.sh | |
parent | 87f93ea4fd86da8bcfd75b7d74b49dce720d8ef6 (diff) |
Added Edgecast and Cachefly CDNs. (#1540)
* Improved ASN update script
* Ran `utils/update_every_lists.sh'
* `tests/do.sh.in' prints the amount of failed pcap(s)
* `utils/asn_update.sh' prints the amount of failed download(s)
Signed-off-by: lns <matzeton@googlemail.com>
Diffstat (limited to 'utils/asn_update.sh')
-rwxr-xr-x | utils/asn_update.sh | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/utils/asn_update.sh b/utils/asn_update.sh index 5224bbc27..81098ab6a 100755 --- a/utils/asn_update.sh +++ b/utils/asn_update.sh @@ -1,6 +1,7 @@ #!/bin/bash -set -e +FAILED_ASN=0 +TOTAL_ASN=0 function processing_list() { local LIST_MERGED="/tmp/list_m" @@ -15,7 +16,11 @@ function create_list() { LIST=/tmp/list for i in "${@:3}"; do - ./get_routes_by_asn.sh "$i" >> $LIST + TOTAL_ASN=$(( TOTAL_ASN + 1 )) + if ! ./get_routes_by_asn.sh "$i" >> $LIST; then + echo "Could not fetch route for ${i} (${1})" + FAILED_ASN=$(( FAILED_ASN + 1 )) + fi done processing_list "$LIST" "$1" "$2" @@ -113,3 +118,15 @@ echo "(1) Downloading Citrix routes..." #Citrix or a more generic LogMeIn stuff? DEST=../src/lib/inc_generated/ndpi_asn_citrix.c.inc create_list NDPI_PROTOCOL_CITRIX $DEST "AS395424" "AS21866" "AS213380" "AS20104" "AS16815" echo "(3) Citrix IPs are available in $DEST" + +echo "(1) Downloading Edgecast routes..." +DEST=../src/lib/inc_generated/ndpi_asn_edgecast.c.inc +create_list NDPI_PROTOCOL_EDGECAST $DEST "AS15133" +echo "(3) Edgecast IPs are available in $DEST" + +if [ ${TOTAL_ASN} -eq ${FAILED_ASN} ]; then + printf '%s: %s\n' "${0}" "All download(s) failed, ./get_routes_by_asn.sh broken?" + exit 1 +else + exit 0 +fi |