From 57fc0d82a52a240eee9046c99b0b0bbfd880f31c Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Mon, 16 Dec 2024 10:27:35 +0100 Subject: [PATCH] - Add missing new files! --- sbin/docker_mk_dir | 33 +++++++++++++++++++++++++++ sbin/docker_tools_install | 48 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100755 sbin/docker_mk_dir create mode 100755 sbin/docker_tools_install diff --git a/sbin/docker_mk_dir b/sbin/docker_mk_dir new file mode 100755 index 0000000..668620d --- /dev/null +++ b/sbin/docker_mk_dir @@ -0,0 +1,33 @@ +#!/bin/bash +#------------------------------------------------------------------------------- + +set -o errexit + + + +grep -e _LOG_ -e _LIB_ .env | grep -e _EXT= | while read line +do + OIFS=$IFS + IFS="=" + + set $line + + IFS=$OIFS + + + grep $1 compose.yaml >/dev/null + + if [[ "$?" == "0" ]] + then + eval echo $2 + fi +done | sort -u | while read dir +do + echo "Add/Create: [${dir}]" + + mkdir -p ${dir} + echo -e '# Ignore everything in this directory\n*\n# Except this file\n!.gitignore' > ${dir}/.gitignore + + git add ${dir}/.gitignore +done + diff --git a/sbin/docker_tools_install b/sbin/docker_tools_install new file mode 100755 index 0000000..351c627 --- /dev/null +++ b/sbin/docker_tools_install @@ -0,0 +1,48 @@ +#!/bin/bash +#------------------------------------------------------------------------------- + +set -o errexit + +DOCKER_TOOLS_HOME_DIR="$(dirname "$(dirname "$0")")" + +if [[ "$1" == "" ]] +then + APPL_HOME_DIR="$PWD" +else + APPL_HOME_DIR="$1" +fi + + + +#------------------------------------------------------------------------------- +function link_create +{ + source="$1" + target="$2" + + if [[ -d "$target" ]] + then + real_target=${target}/$( basename "${source}") + else + real_target=${target} + fi + + if [[ -e "${real_target}" ]] + then + mv ${real_target} ${real_target}.old + fi + + ln -s ${source} ${target} +} + + + +#------------------------------------------------------------------------------- + +DOCKER_TOOLS_HOME_DIR=$( realpath --relative-to ${APPL_HOME_DIR} ${DOCKER_TOOLS_HOME_DIR}) +cd ${APPL_HOME_DIR} + + +link_create ${DOCKER_TOOLS_HOME_DIR}/sbin . + +link_create env.dist env