2023-03-25 12:36:27 -04:00
|
|
|
#!/bin/bash
|
2023-04-01 05:08:06 -04:00
|
|
|
# SPDX-License-Identifier: MIT
|
2023-03-25 12:36:27 -04:00
|
|
|
|
|
|
|
set -x
|
|
|
|
|
2023-05-21 08:28:45 -04:00
|
|
|
source $(dirname $0)/lxc-helpers/lxc-helpers-lib.sh
|
2023-05-16 19:02:22 -04:00
|
|
|
|
2023-03-29 18:27:54 -04:00
|
|
|
: ${LXC_IP_PREFIX:=10.0.8}
|
2023-03-25 14:14:55 -04:00
|
|
|
|
2023-03-25 12:36:27 -04:00
|
|
|
function install_docker() {
|
|
|
|
if ! systemctl is-active --quiet docker; then
|
2023-05-16 19:02:22 -04:00
|
|
|
lxc_install_docker_inside
|
2023-03-25 12:36:27 -04:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function install_other() {
|
2023-05-16 19:02:22 -04:00
|
|
|
local packages="sudo git"
|
2023-03-25 12:36:27 -04:00
|
|
|
if ! which $packages ; then
|
|
|
|
apt-get install -y -qq $packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function setup() {
|
2023-03-25 13:21:44 -04:00
|
|
|
install_other
|
2023-03-25 12:36:27 -04:00
|
|
|
install_docker
|
2023-05-16 19:02:22 -04:00
|
|
|
lxc_install_lxc_inside $LXC_IP_PREFIX
|
2023-03-25 12:36:27 -04:00
|
|
|
}
|
|
|
|
|
2023-04-05 11:40:06 -04:00
|
|
|
"${@:-setup}"
|