diff options
author | Test User | 2020-02-10 08:34:04 -0700 |
---|---|---|
committer | Test User | 2020-02-10 08:34:04 -0700 |
commit | 7062f3f6555c75cf34caea99f18fcb627a100ab9 (patch) | |
tree | 53f6d2fb764b61440ce809639423e19ec8c0d5c8 /update-relays.sh | |
parent | d6929e31e547e02d0182e9bfca60550ed51c1230 (diff) | |
download | aur-7062f3f6555c75cf34caea99f18fcb627a100ab9.tar.gz |
updated to 2020.1
Diffstat (limited to 'update-relays.sh')
-rwxr-xr-x | update-relays.sh | 35 |
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 |