29 lines
915 B
Bash
29 lines
915 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
DOWNLOAD_BASE_URL=https://downloads.getmonero.org/cli/
|
||
|
|
||
|
case $(uname -m) in
|
||
|
x86_64) ARCH=x64 ;;
|
||
|
i?86) ARCH=x86 ;;
|
||
|
aarch64) ARCH=armv8 ;;
|
||
|
arm*) ARCH=armv7 ;;
|
||
|
*) exit 9 ;;
|
||
|
esac
|
||
|
|
||
|
mkdir -p /downloads
|
||
|
cd /downloads
|
||
|
wget https://www.getmonero.org/downloads/hashes.txt
|
||
|
wget https://raw.githubusercontent.com/monero-project/monero/master/utils/gpg_keys/binaryfate.asc
|
||
|
filename=$(awk "/ monero-linux-${ARCH}-v/{print \$2;exit}" < hashes.txt)
|
||
|
[ -e ${filename} ] || wget "${DOWNLOAD_BASE_URL}${filename}"
|
||
|
grep "${filename}" hashes.txt > "${filename}.sha256"
|
||
|
sha256sum -c "${filename}.sha256" || exit 1
|
||
|
gpg --keyid-format long --with-fingerprint binaryfate.asc | grep "^uid.*<binaryfate@getmonero.org>" || exit 2
|
||
|
gpg --import binaryfate.asc
|
||
|
gpg --verify hashes.txt || exit 3
|
||
|
tar axvf "${filename}" >contents.txt
|
||
|
dname=$(sort <contents.txt | head -n1)
|
||
|
mv "${dname}" /monero
|
||
|
cd /
|
||
|
rm -rf /downloads
|