43 lines
1.5 KiB
Shell
43 lines
1.5 KiB
Shell
|
|
#!/usr/bin/env bash
|
||
|
|
# Place the official monero-wallet-rpc next to an OnionWire binary.
|
||
|
|
#
|
||
|
|
# The TUI spawns a bare "monero-wallet-rpc" from that directory before PATH.
|
||
|
|
# F7 remote daemon and remote wallet RPC are unchanged. An absolute
|
||
|
|
# wallet_rpc_bin is not replaced by this file.
|
||
|
|
#
|
||
|
|
# Hashes are the CLI lines from https://www.getmonero.org/downloads/hashes.txt
|
||
|
|
# for v0.18.5.3. Verify that signature out of band before treating a new pin
|
||
|
|
# as canonical; this script checks the sha256 of the tarball it downloads.
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
dest="${1:?usage: fetch-monero-wallet-rpc.sh <directory-of-onionwire-binary>}"
|
||
|
|
mkdir -p "$dest"
|
||
|
|
|
||
|
|
case "$(uname -m)" in
|
||
|
|
x86_64)
|
||
|
|
file=monero-linux-x64-v0.18.5.3.tar.bz2
|
||
|
|
sum=3333d0e04c9cbe3023e7e2b6dd369c407f36bb8df5b05fb0a19d7685b3d56dfc
|
||
|
|
;;
|
||
|
|
aarch64)
|
||
|
|
file=monero-linux-armv8-v0.18.5.3.tar.bz2
|
||
|
|
sum=1490114f795ad2f67f57bc8d167c3e2539e9f173fc46f02f70ef4abf685f8c66
|
||
|
|
;;
|
||
|
|
*)
|
||
|
|
echo "fetch-monero-wallet-rpc: unsupported arch $(uname -m)" >&2
|
||
|
|
exit 1
|
||
|
|
;;
|
||
|
|
esac
|
||
|
|
|
||
|
|
url="https://downloads.getmonero.org/cli/$file"
|
||
|
|
work="$(mktemp -d)"
|
||
|
|
trap 'rm -rf "$work"' EXIT
|
||
|
|
curl -fL --retry 3 -o "$work/$file" "$url"
|
||
|
|
echo "$sum $work/$file" | sha256sum -c -
|
||
|
|
tar -xjf "$work/$file" -C "$work" --wildcards '*/monero-wallet-rpc'
|
||
|
|
found="$(find "$work" -type f -name monero-wallet-rpc -print -quit)"
|
||
|
|
if [ -z "$found" ]; then
|
||
|
|
echo "fetch-monero-wallet-rpc: tarball had no monero-wallet-rpc" >&2
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
install -m 755 "$found" "$dest/monero-wallet-rpc"
|
||
|
|
echo "installed $dest/monero-wallet-rpc"
|