#!/bin/bash MANDATORY_PACKAGES_STRING="nginx php-fpm postgresql-client php-pgsql php-intl php-curl php-gd php-zip php-imap php-xml php-mbstring" function check() { PREFIX="recipe:dolibarr:check" : $PREFIX check_mandatory_packages || return 11 check_one_release || return 12 } function check_mandatory_packages() { lxc exec "$CONTAINER" -- bash </dev/null | grep -q ^ii done EOF } function check_one_release() { lxc exec "$CONTAINER" -- /TOOLBOX/fd -1q -tf "dolibarr-" /var/www } function install() { echo "recipe:dolibarr installing..." lxc exec "$CONTAINER" -- bash </dev/null apt update apt install -y $MANDATORY_PACKAGES_STRING cd /var/www PATH="\$PATH:/opt/miaou-bash/tools" VERSION="\$(wget_semver github Dolibarr/dolibarr)" if [[ ! -f "dolibarr-\$VERSION.tgz" ]]; then wget_release github Dolibarr/dolibarr else echo "dolibarr version=\$VERSION already downloaded!" fi EOF } . "$MIAOU_BASEDIR/lib/init.sh" arg1_required "$@" readonly CONTAINER="$1" launch_container "$CONTAINER" check || ( install check )