Skip to content

Instantly share code, notes, and snippets.

@genecyber
Created November 19, 2015 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save genecyber/a5de6853251cb4427ea9 to your computer and use it in GitHub Desktop.
Save genecyber/a5de6853251cb4427ea9 to your computer and use it in GitHub Desktop.
curl https://install.21.co/bitcoin-computer/install.sh | sudo bash
Congratulations, you just saved $365. That's all there is to it.
@genecyber
Copy link
Author

!/bin/bash

set -e

TWO1_PACKAGES=(zerotier-one)
TWO1_PACKAGES+=(bitcoind)
TWO1_PACKAGES+=(minerd)
TWO1_PACKAGES+=(two1)

Default to stable apt distribution if APT_DIST is not specified

if [ -z "$APT_DIST" ]; then
APT_URL="https://apt.21.co"
APT_DIST="stable"
fi

Add 21 apt repository

echo "deb $APT_URL $APT_DIST main" > /etc/apt/sources.list.d/twentyone.list

Back up this script to 21-recover

if [ ! -f /usr/bin/21-recover ]; then
sudo cp /usr/bin/21 /usr/bin/21-recover
fi

Install apt packages

apt-get update
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get -y --force-yes install ${TWO1_PACKAGES[@]}

Update motd

sudo wget -L -q https://install.21.co/bitcoin-computer/motd -O /etc/motd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment