forked from empeje/core-eng
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bitcoin.sh
executable file
·32 lines (31 loc) · 944 Bytes
/
bitcoin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
val_of_platform() {
case $1 in
'darwin'*)
echo 'x86_64-apple-darwin'
;;
'x86_64'*)
echo 'x86_64-linux-gnu'
;;
'arm'*)
echo 'arm-linux-gnueabihf'
;;
'aarch64'*)
echo 'aarch64-linux-gnu'
;;
*)
echo 'unknown'
;;
esac
}
platform=$(val_of_platform $(uname -m))
echo "Platform: ${platform} to $(uname -m) architecture"
if [[ $OSTYPE == 'darwin'* ]]
then
# URL to Bitcoin v22.0
curl -o bitcoin.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/fa6b4765d81016166f6de2bdad96cfe914c1439f/Formula/bitcoin.rb
brew install ./bitcoin.rb
else
curl -o bitcoin-22.0-${platform}.tar.gz https://bitcoincore.org/bin/bitcoin-core-22.0/bitcoin-22.0-${platform}.tar.gz
tar xzf bitcoin-22.0-${platform}.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-22.0/bin/*
fi