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