Author

Topic: Install script for Ubuntu (Read 1221 times)

full member
Activity: 195
Merit: 100
August 03, 2014, 04:10:54 PM
#4
I just installed onto Mint. Armory did a great job of pointing me to, downloading and installing bitcoin core. Very slick.
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
July 31, 2014, 09:45:23 AM
#3
Is it compile the source?

No, it installs the official .deb package (compiled and signed by the Armory devs).
sr. member
Activity: 364
Merit: 250
July 31, 2014, 05:01:56 AM
#2
Is it compile the source?
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
July 30, 2014, 04:58:30 PM
#1
This is an install script for Armory on Ubuntu. It's nothing real special, but I needed it for myself (for Travis CI) and thought I may as well share.

It locates and automatically downloads, verifies, and installs the latest stable version of Armory plus all required prerequisites. Please note that on Ubuntu Server edition, there are a lot of GUI-related prerequisites that while technically required (and installed by this script), aren't required in practice, so you may prefer not to use this script in that case.

Code:
#!/bin/bash

set -e

DOWNLOADS="`curl -fsS --retry 10 https://s3.amazonaws.com/bitcoinarmory-media/announce.txt | awk '/^downloads/{print $2}'`"
echo "$DOWNLOADS" | grep -q '^https://' || { echo "Can't find Armory downloads URL"; exit 1; }

uname -m | grep -q '64$' && BITS=64 || BITS=32
LATEST="`curl -fsS --retry 10 \"$DOWNLOADS\" | grep "^Armory [0-9.]* Ubuntu [0-9.,]*\`lsb_release -rs\`[0-9.,]* $BITS " | sort -k 2V | tail -1 | awk '{print $6}'`"
echo "$LATEST" | grep -q '^https://' || { echo "Can't find latest Armory download URL"; exit 1; }

curl -fsS --retry 10 -o '/tmp/armory.deb' "$LATEST"

sudo apt-get update
sudo apt-get install dpkg-sig gdebi-core

gpg -q --keyserver keyserver.ubuntu.com --recv-keys 98832223
dpkg-sig --verify /tmp/armory.deb | grep -q 'GOODSIG.*821F122936BDD565366AC36A4AB16AEA98832223' || { echo "Signature verification failed"; exit 1; }

sudo gdebi /tmp/armory.deb
rm /tmp/armory.deb

Here's a version for unattended installation (the one I use for Travis CI, more or less):

Code:
#!/bin/bash

set -e

DOWNLOADS="`curl -fsS --retry 10 https://s3.amazonaws.com/bitcoinarmory-media/announce.txt | awk '/^downloads/{print $2}'`"
echo "$DOWNLOADS" | grep -q '^https://' || { echo "Can't find Armory downloads URL"; exit 1; }

uname -m | grep -q '64$' && BITS=64 || BITS=32
LATEST="`curl -fsS --retry 10 \"$DOWNLOADS\" | grep "^Armory [0-9.]* Ubuntu [0-9.,]*\`lsb_release -rs\`[0-9.,]* $BITS " | sort -k 2V | tail -1 | awk '{print $6}'`"
echo "$LATEST" | grep -q '^https://' || { echo "Can't find latest Armory download URL"; exit 1; }

curl -fsS --retry 10 -o '/tmp/armory.deb' "$LATEST"

sudo apt-get -q update
sudo apt-get -yq install dpkg-sig gdebi-core

gpg -q --keyserver keyserver.ubuntu.com --recv-keys 98832223
dpkg-sig --verify /tmp/armory.deb | grep -q 'GOODSIG.*821F122936BDD565366AC36A4AB16AEA98832223' || { echo "Signature verification failed"; exit 1; }

sudo gdebi -nq /tmp/armory.deb
rm /tmp/armory.deb

It's not as thorough as the built-in secure downloader because it only checks the signatures of the very last download (the install .deb file itself), but it was good enough for my purposes.
Jump to: