vms/recipes/alpine/provisionning/matchbox.sh

30 lines
834 B
Bash
Raw Normal View History

2022-12-06 15:44:25 +01:00
#!/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}"
MATCHBOX_DIR="/var/lib/matchbox"
ASSETS_DIR="${MATCHBOX_DIR}/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
cp ./scripts/get-flatcar /usr/local/bin
./scripts/get-flatcar stable current "${ASSETS_DIR}"
./scripts/get-flatcar stable 3374.2.0 "${ASSETS_DIR}"
useradd -U "${MATCHBOX_USER}"
mkdir -p "${ASSETS_DIR}"
mv ./examples/assets/flatcar "${ASSETS_DIR}"
chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${MATCHBOX_DIR}"
chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${ASSETS_DIR}"
cp -rp ./scripts/tls /root
exit "${?}"