#!/bin/bash ### CHECK function check() { PREFIX="recipe:discourse:check" container_exists "$CONTAINER" || return 1 container_running "$CONTAINER" || return 2 var_discourse_exists "$CONTAINER" || return 3 } function var_discourse_exists() { container="$1" lxc exec "$container" -- test -d /var/discourse/containers } ### INSTALL function install() { PREFIX="recipe:discourse:install" : $PREFIX launch_container "$CONTAINER" "-o nesting" echo "initializing discourse ... " lxc exec "$CONTAINER" -- bash < /dev/null apt update apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin mkdir /var/discourse git clone https://github.com/discourse/discourse_docker.git /var/discourse EOF PREFIX="" echo "OK" } ### MAIN . "$MIAOU_BASEDIR/lib/init.sh" arg1_required "$@" readonly CONTAINER="$1" check || ( install check )