-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup-client.sh
executable file
·110 lines (96 loc) · 4.23 KB
/
setup-client.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/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 <<EOF
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux)
mQENBFAQqgUBCADOMIkW4BliIOZyks8addo/SJjXRVjbAs2/O5pINHTRRo8DabCB
ISbKAjmxpkepQ/mN2o4cxK+3IGpSVQhrhLRyBRRMZv1MH4n+Yoq2AemO83ILQthi
39jHwKm107untAeLKTwt1DSY1HnFEQJl5bwG7HHqz3iD9HCwY5bX4eDrm4AxW0NG
rPdZpnLcuZfgMWEzRnhSkaTrCKiysQs5BVF3twbmzgO6hK26XjEOCNeOgHWGAbjZ
tky9zcjg2c1FG6g7pYyPyeLkSpF+CfhYe5pclrSvB708wVb+NczBD9MfInV9Er9/
UYr2kd4rYttc/tUFSCPjKoT9grO7dtIHbZVtABEBAAG0J0dyaWRjZW50cmljIElu
Yy4gPGluZm9AZ3JpZGNlbnRyaWMuY29tPokBOAQTAQIAIgUCUBCqBQIbAwYLCQgH
AwIGFQgCCQoLBBYCAwECHgECF4AACgkQ9sSiVmboP0x1eAgAkpUEzJ5ZxjZPxbPH
de5ryZpUvb/3VKsXiV6mRPHM78Psdjc68dnm3n1V57g5zc57n2mD/li80Y+bqzgk
eWjMg6JRr1bBIgz2kKVtXQhmDWsk9tu3KW3AieVArsZWjGo8Oab4jNZO0gq2QOcR
Bt/uTYW2wU9xO0S/AyRtwBUqjDP7Q9LKp2i5UrBCtQfXQ1WFvUgQzhcYwFkoO/oH
bi4S4hcMsGBQjsrtQkorwj8Fp3QuUErvjnjT6+6RqO+W2SjYb7eFSBBHRD6Wnas4
TDETaIfuEOonLXzRjaQ2QTprVIZDQkY9Qnp/BZXfWheXeIkq6jsWyV87Wmwm+V8e
zGdl0Q==
=DHFj
-----END PGP PUBLIC KEY BLOCK-----
EOF
# Detect distro by finding out how core utils are provided.
if dpkg -l coreutils >/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
XtxOAvQmAbR9z6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BA0to7FW8dQXFIOyNiJFAOT2j8P5+tVdq8
wB0PDSH8yRpn4HdJ9RYquau4OkjluxOWf0uRaS//SUcCZh+1/KBEOmcvBHYRZA5J
l/nakCgxGb2paQOzqqpOcHKvlyLuzO5uybMXaipLExTGJXBlXrbbASfXa/yGYSAG
iVrGz9CE6676dMlm8F+s3XXE13QZrXmjloc6jwOljnfAkjTGXjiB7OULESed96MR
XtfLk0W5Ab9pd7tKDR6QHI7rgHXfCopRnZ2VVQ==
=V/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