docker_tools/sbin/docker_tools_install

49 lines
921 B
Plaintext
Raw Normal View History

2024-12-16 10:27:35 +01:00
#!/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