-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mullvad VPN service added (based on entry node IP addresses)
- Loading branch information
1 parent
bc91192
commit a75a9f6
Showing
8 changed files
with
622 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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_mullvad_match.c.inc | ||
TMP=/tmp/mullvad.json | ||
LIST=/tmp/mullvad.list | ||
LIST_MERGED=/tmp/mullvad.list.merged | ||
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}" | ||
./mergeipaddrlist.py $LIST > $LIST_MERGED | ||
./ipaddr2list.py $LIST_MERGED NDPI_PROTOCOL_MULLVAD > $DEST | ||
is_file_empty "${DEST}" | ||
|
||
rm -f $TMP $LIST $LIST_MERGED | ||
|
||
echo "(3) Mullvad IPs are available in $DEST" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters