diff options
author | Nardi Ivan <nardi.ivan@gmail.com> | 2024-07-31 15:12:33 +0200 |
---|---|---|
committer | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2024-09-05 16:36:50 +0200 |
commit | f350379e95935448c22a387a561b57d50251f422 (patch) | |
tree | c066e030c7b69ccc0ba52294a85da447561e27f8 /utils | |
parent | c713c894b6146c7884e24895cd3df1d7e35ee120 (diff) |
Add detection of NordVPN
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/nordvpn_ip_addresses_download.sh | 30 | ||||
-rwxr-xr-x | utils/update_every_lists.sh | 2 |
2 files changed, 32 insertions, 0 deletions
diff --git a/utils/nordvpn_ip_addresses_download.sh b/utils/nordvpn_ip_addresses_download.sh new file mode 100755 index 000000000..1cf8fe90e --- /dev/null +++ b/utils/nordvpn_ip_addresses_download.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -e + +cd "$(dirname "${0}")" || exit 1 +. ./common.sh || exit 1 + +DEST=../src/lib/inc_generated/ndpi_nordvpn_match.c.inc +TMP=/tmp/nordvpn.json +LIST=/tmp/nordvpn.list +LIST_MERGED=/tmp/nordvpn.list_m +ORIGIN=https://api.nordvpn.com/v1/servers?limit=16384 +#No ipv6 yet + +echo "(1) Downloading file..." +http_response=$(curl -s -o $TMP -w "%{http_code}" ${ORIGIN}) +check_http_response "${http_response}" +is_file_empty "${TMP}" + +echo "(2) Processing IP addresses..." +jq -r '.[] | .ips | .[].ip | select(.version==4) | .ip' $TMP > $LIST +is_file_empty "${LIST}" +./mergeipaddrlist.py $LIST > $LIST_MERGED +is_file_empty "${LIST_MERGED}" +./ipaddr2list.py $LIST_MERGED NDPI_PROTOCOL_NORDVPN > $DEST +is_file_empty "${DEST}" + +rm -f ${TMP} ${LIST} ${LIST_MERGED} + +echo "(3) NordVPN IPs are available in $DEST" +exit 0 diff --git a/utils/update_every_lists.sh b/utils/update_every_lists.sh index f01480e1c..4bb285fda 100755 --- a/utils/update_every_lists.sh +++ b/utils/update_every_lists.sh @@ -30,6 +30,8 @@ RETVAL=$(( RETVAL + $? )) RETVAL=$(( RETVAL + $? )) ./crawlers_ip_addresses_download.sh RETVAL=$(( RETVAL + $? )) +./nordvpn_ip_addresses_download.sh +RETVAL=$(( RETVAL + $? )) ./asn_update.sh RETVAL=$(( RETVAL + $? )) |