summarylogtreecommitdiffstats
path: root/update-relays.sh
diff options
context:
space:
mode:
authorTest User2020-02-10 08:34:04 -0700
committerTest User2020-02-10 08:34:04 -0700
commit7062f3f6555c75cf34caea99f18fcb627a100ab9 (patch)
tree53f6d2fb764b61440ce809639423e19ec8c0d5c8 /update-relays.sh
parentd6929e31e547e02d0182e9bfca60550ed51c1230 (diff)
downloadaur-7062f3f6555c75cf34caea99f18fcb627a100ab9.tar.gz
updated to 2020.1
Diffstat (limited to 'update-relays.sh')
-rwxr-xr-xupdate-relays.sh35
1 files changed, 19 insertions, 16 deletions
diff --git a/update-relays.sh b/update-relays.sh
index ef63dcd6afbf..88f43c3ca60b 100755
--- a/update-relays.sh
+++ b/update-relays.sh
@@ -1,19 +1,22 @@
#!/bin/bash
+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
+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
- JSONRPC_RESPONSE="$(curl -X POST \
- --fail \
- -H "Content-Type: application/json" \
- -d '{"jsonrpc": "2.0", "id": "0", "method": "relay_list_v3"}' \
- https://api.mullvad.net/rpc/)"
- echo "$JSONRPC_RESPONSE" | node -e "$JSONRPC_CODE" > dist-assets/relays.json
+JSONRPC_RESPONSE="$(curl -X POST \
+ --fail \
+ -H "Content-Type: application/json" \
+ -d '{"jsonrpc": "2.0", "id": "0", "method": "relay_list_v3"}' \
+ https://api.mullvad.net/rpc/)"
+echo $JSONRPC_RESPONSE | node -e "$JSONRPC_CODE" > dist-assets/relays.json