2016-02-05 21:48:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-01-27 21:08:50 +00:00
|
|
|
set -e
|
2016-02-05 21:48:27 +00:00
|
|
|
|
2017-01-27 19:52:09 +00:00
|
|
|
RKT_VERSION="v1.18.0"
|
2016-10-18 23:58:25 +00:00
|
|
|
CMD="cp"
|
2016-02-05 21:48:27 +00:00
|
|
|
|
2016-10-18 23:58:25 +00:00
|
|
|
if [ ! -v DEST_DIR ]; then
|
|
|
|
DEST_DIR="/usr/local/bin"
|
|
|
|
CMD="sudo cp"
|
|
|
|
fi
|
2016-02-17 02:57:12 +00:00
|
|
|
|
2017-01-28 00:07:14 +00:00
|
|
|
if [[ $(which rkt >/dev/null && rkt version | head -n 1) == "rkt Version: 1.18.0" ]]; then
|
|
|
|
echo "rkt installed; Skipping"
|
|
|
|
else
|
|
|
|
printf "Fetching rkt-%s.tar.gz\n" "${RKT_VERSION}"
|
|
|
|
cd /tmp
|
|
|
|
wget -q https://github.com/coreos/rkt/releases/download/$RKT_VERSION/rkt-$RKT_VERSION.tar.gz -O rkt.tar.gz
|
|
|
|
tar xzf rkt.tar.gz
|
2016-05-07 17:14:36 +00:00
|
|
|
|
2017-01-28 00:07:14 +00:00
|
|
|
$CMD rkt-$RKT_VERSION/rkt $DEST_DIR
|
|
|
|
$CMD rkt-$RKT_VERSION/*.aci $DEST_DIR
|
|
|
|
fi
|
2016-02-05 23:08:33 +00:00
|
|
|
|
|
|
|
rkt version
|