aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorsnicket2100 <57048005+snicket2100@users.noreply.github.com>2023-08-02 19:44:16 +0200
committerGitHub <noreply@github.com>2023-08-02 19:44:16 +0200
commit1fbe8a23854f3c27bbe5d15f95f62ce42e3c73dc (patch)
tree2137f9959fcde2bff786363789e486f9d110f027 /utils
parent196395398ebdeb47e0da102f7bb489b355f63ae2 (diff)
Mullvad VPN service added (based on entry node IP addresses) (#2062)
Diffstat (limited to 'utils')
-rwxr-xr-xutils/mullvad_ip_addresses_download.sh28
-rwxr-xr-xutils/update_every_lists.sh2
2 files changed, 30 insertions, 0 deletions
diff --git a/utils/mullvad_ip_addresses_download.sh b/utils/mullvad_ip_addresses_download.sh
new file mode 100755
index 000000000..837f1bda7
--- /dev/null
+++ b/utils/mullvad_ip_addresses_download.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+set -e
+
+cd "$(dirname "${0}")" || exit 1
+. ./common.sh || exit 1
+
+DEST=../src/lib/inc_generated/ndpi_mullvad_match.c.inc
+TMP=/tmp/mullvad.json
+LIST=/tmp/mullvad.list
+ORIGIN=https://api-www.mullvad.net/www/relays/all/
+
+
+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 '.[].ipv4_addr_in' $TMP > $LIST # TODO: ipv6
+is_file_empty "${LIST}"
+./ipaddr2list.py $LIST NDPI_PROTOCOL_MULLVAD > $DEST
+is_file_empty "${DEST}"
+
+rm -f $TMP $LIST
+
+echo "(3) Mullvad IPs are available in $DEST"
+exit 0
diff --git a/utils/update_every_lists.sh b/utils/update_every_lists.sh
index 95f72476e..3f0f75adf 100755
--- a/utils/update_every_lists.sh
+++ b/utils/update_every_lists.sh
@@ -36,6 +36,8 @@ RETVAL=$(( RETVAL + $? ))
./gambling_sites_download.sh
RETVAL=$(( RETVAL + $? ))
+./mullvad_ip_addresses_download.sh
+RETVAL=$(( RETVAL + $? ))
./protonvpn_ip_addresses_download.sh
RETVAL=$(( RETVAL + $? ))