2016-02-05 21:48:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2016-05-07 17:06:57 +00:00
|
|
|
RKT_VERSION="v1.5.1"
|
2016-05-07 17:14:36 +00:00
|
|
|
RKT_SHA512="8163ca59fc8c44c9c2997431d16274d81d2e82ff2956c860607f4c111de744b78cdce716f8afbacf7173e0cdce25deac73ec95a30a8849bbf58d35faeb84e398"
|
2016-02-05 21:48:27 +00:00
|
|
|
DEST_DIR="/usr/local/bin"
|
|
|
|
|
2016-02-17 02:57:12 +00:00
|
|
|
sudo mkdir -p /etc/rkt/net.d
|
|
|
|
echo '{"name": "default", "type": "ptp", "ipMasq": false, "ipam": { "type": "host-local", "subnet": "172.16.28.0/24", "routes": [ { "dst": "0.0.0.0/0" } ] } }' | sudo tee -a /etc/rkt/net.d/99-network.conf
|
|
|
|
|
2016-05-07 17:14:36 +00:00
|
|
|
if [ ! -d "rkt-${RKT_VERSION}" ]; then
|
|
|
|
printf "rkt-%s/ doesn't exist\n" "${RKT_VERSION}"
|
|
|
|
if [ ! -f "rkt-${RKT_VERSION}.tar.gz" ]; then
|
|
|
|
printf "Fetching rkt-%s.tar.gz\n" "${RKT_VERSION}"
|
|
|
|
wget https://github.com/coreos/rkt/releases/download/$RKT_VERSION/rkt-$RKT_VERSION.tar.gz
|
|
|
|
expected_version=$(printf 'SHA512(rkt-%s.tar.gz)= %s' "${RKT_VERSION}" "${RKT_SHA512}")
|
|
|
|
actual_version=$(openssl sha512 rkt-${RKT_VERSION}.tar.gz)
|
|
|
|
if [ "${expected_version}" != "${actual_version}" ]; then
|
|
|
|
printf "SHA512 of rkt-%s failed\n" "${RKT_VERSION}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
tar xzvf rkt-$RKT_VERSION.tar.gz
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-02-05 21:48:27 +00:00
|
|
|
sudo cp rkt-$RKT_VERSION/rkt $DEST_DIR
|
|
|
|
sudo cp rkt-$RKT_VERSION/*.aci $DEST_DIR
|
2016-02-05 23:08:33 +00:00
|
|
|
|
|
|
|
rkt version
|