#!/bin/bash # Install the Reactor client in an Ubuntu or Centos6 environment. # Can be run interactively: # sudo bash setup-client.sh # Or passed to an instance via cloud-init: # nova boot ... --user-data setup-client.sh ... set -x set -e KEYFILE=$(mktemp) cleanup() { rm -f $KEYFILE } trap cleanup EXIT # This is the GPG Gridcentric package signing public key. cat >$KEYFILE </dev/null 2>&1; then # Import the package key and add repos. apt-key add $KEYFILE cat >/etc/apt/sources.list.d/reactor.list <<-EOF deb http://downloads.gridcentric.com/packages/reactor/reactor-core/precise gridcentric multiverse EOF # Install the client packages. apt-get update apt-get -y -o APT::Install-Recommends=1 install reactor-client elif rpm -ql coreutils >/dev/null 2>&1; then # Import the package key and add repos. rpm --import $KEYFILE cat >/etc/yum.repos.d/reactor.repo <<-EOF [reactor] name=Gridcentric Reactor baseurl=http://downloads.gridcentric.com/packages/reactor/reactor-core/centos/ gpgcheck=1 enabled=1 EOF # Add requisite EPEL repos, if not already installed. # This is the EPEL public key. You can verify at # https://fedoraproject.org/static/0608B895.txt cat >$KEYFILE <<-EOF -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.5 (GNU/Linux) mQINBEvSKUIBEADLGnUj24ZVKW7liFN/JA5CgtzlNnKs7sBg7fVbNWryiE3URbn1 JXvrdwHtkKyY96/ifZ1Ld3lE2gOF61bGZ2CWwJNee76Sp9Z+isP8RQXbG5jwj/4B M9HK7phktqFVJ8VbY2jfTjcfxRvGM8YBwXF8hx0CDZURAjvf1xRSQJ7iAo58qcHn XtxOAvQmAbR9z6Q/h/D+Y/PhoIJp1OV4VNHCbCs9M7HUVBpgC53PDcTUQuwcgeY6 pQgo9eT1eLNSZVrJ5Bctivl1UcD6P6CIGkkeT2gNhqindRPngUXGXW7Qzoefe+fV QqJSm7Tq2q9oqVZ46J964waCRItRySpuW5dxZO34WM6wsw2BP2MlACbH4l3luqtp Xo3Bvfnk+HAFH3HcMuwdaulxv7zYKXCfNoSfgrpEfo2Ex4Im/I3WdtwME/Gbnwdq 3VJz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6I -----END PGP PUBLIC KEY BLOCK----- EOF rpm -qi gpg-pubkey-0608b895-4bd22942 > /dev/null 2>&1 || rpm --import $KEYFILE rpm -qa | grep -q epel-release || rpm -Uvh \ http://dl.fedoraproject.org/pub/epel/6/`uname -m`/epel-release-6-8.noarch.rpm # Install the client packages. yum -y install reactor-client else # Unknown system! exit 2 fi