#!/bin/bash

set -e -u

echo "# Preparing node"

userdel user || echo ignore
useradd -m -s /bin/bash user --home-dir /home/user

# sleep 4
apt-get update
apt-get install build-essential -y
apt-get install cmake -y


VERSION=""
VERSION_CODENAME=""

. /etc/os-release

if [ "$VERSION_CODENAME" == "bionic" ]; then
    apt-get install qtbase5-dev catch -y
elif [ "$VERSION_CODENAME" == "focal" ]; then
    apt-get install qtbase5-dev catch -y
elif [ "$VERSION" == "11 (bullseye)" ]; then
    apt-get install qtbase5-dev catch2 -y
else
    apt-get install qt6-base-dev catch2 -y
fi

# /usr/bin/lxc-post-create.sh test

echo "# [$0] Fin"
