vms/recipes/alpine/provisionning/matchbox.sh

23 lines
586 B
Bash

#!/bin/sh
VERSION=0.9.1
ARCH=amd64
BIN="matchbox"
FILENAME="matchbox-v${VERSION}-linux-${ARCH}.tar.gz"
URL="https://github.com/poseidon/matchbox/releases/download/v${VERSION}/${FILENAME}"
ASSETS_DIR="/var/lib/matchbox/assets"
MATCHBOX_USER="matchbox"
echo "Installing matchbox"
cd /tmp
wget "${URL}"
tar -xzvf "${FILENAME}"
cd "matchbox-v${VERSION}-linux-${ARCH}"
cp ${BIN} /usr/local/bin
./scripts/get-flatcar
useradd -U "${MATCHBOX_USER}"
mkdir -p "${ASSETS_DIR}"
mv ./examples/assets/flatcar "${ASSETS_DIR}"
chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${ASSETS_DIR}"
exit "${?}"