summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--README.md9
-rwxr-xr-xbuild.sh18
2 files changed, 16 insertions, 11 deletions
diff --git a/README.md b/README.md
index 32fbd659bf..bc24134909 100644
--- a/README.md
+++ b/README.md
@@ -85,15 +85,6 @@ homebrew:
cargo build
```
-1. Get the latest list of Mullvad relays:
- ```bash
- curl -X POST \
- -H "Content-Type: application/json" \
- -d '{"jsonrpc": "2.0", "id": "0", "method": "relay_list"}' \
- https://api.mullvad.net/rpc/ \
- -o dist-assets/relays.json
- ```
-
1. Run the daemon debug binary with verbose logging to the terminal with:
```
sudo MULLVAD_RESOURCE_DIR="./dist-assets" ./target/debug/mullvad-daemon -vv
diff --git a/build.sh b/build.sh
index 75c83327ea..e88a076798 100755
--- a/build.sh
+++ b/build.sh
@@ -130,11 +130,25 @@ if [[ "$(uname -s)" != "MINGW"* ]]; then
fi
echo "Updating relay list..."
+set +e
+read -d '' JSONRPC_CODE <<-JSONRPC_CODE
+var buff = "";
+process.stdin.on('data', function (chunk) {
+ buff += chunk;
+})
+process.stdin.on('end', function () {
+ var obj = JSON.parse(buff);
+ var output = JSON.stringify(obj.result, null, ' ');
+ process.stdout.write(output);
+})
+JSONRPC_CODE
+set -e
+
curl -X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": "0", "method": "relay_list"}' \
- https://api.mullvad.net/rpc/ \
- -o dist-assets/relays.json
+ https://api.mullvad.net/rpc/ | \
+node -e "$JSONRPC_CODE" > dist-assets/relays.json
echo "Installing JavaScript dependencies..."
yarn install