open-nomad/scripts/install_rkt.sh

26 lines
566 B
Bash
Raw Normal View History

#!/bin/bash
set -ex
2017-01-27 19:52:09 +00:00
RKT_VERSION="v1.18.0"
CMD="cp"
if [ ! -v DEST_DIR ]; then
DEST_DIR="/usr/local/bin"
CMD="sudo cp"
fi
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
tar xzvf rkt-$RKT_VERSION.tar.gz
fi
fi
$CMD rkt-$RKT_VERSION/rkt $DEST_DIR
$CMD rkt-$RKT_VERSION/*.aci $DEST_DIR
rkt version