testing copy()

This commit is contained in:
Gerhard Hoffmann 2022-06-04 22:07:27 +02:00
parent a3e311e375
commit 21591d8e3d

View File

@ -42,9 +42,15 @@ copy () {
continue
fi
# macht fuer dc keinen sinn
# local sysdir=$(echo $f |
# sed -E -e s'=(.*szeged/[0-9]/[0-9])(.*)(/.*)=\2=g')
# TODO: szeged darf nicht sein
# local readonlt __cl=$CUSTOMER_LOCATION
# local readonly __q="'"
# xxx='$('"echo $f | sed -E -e ${__q}s=(.*$__cl/[0-9]/[0-9])(.*)(/.*)=\2=g$__q"')'
# echo $xxx
# eval "echo $xxx"
local readonly __sysdir=$(echo $f |
sed -E -e s'=(.*szeged/[0-9]/[0-9])(.*)(/.*)=\2=g')
# TODO: kuerzen
@ -55,48 +61,53 @@ copy () {
local readonly __f=${f##*/}
local readonly __m="${CUSTOMER_ID_BASE_DIR}/${f}"
local __p=""
local __p="${__sysdir}/${__f}"
# echo "TEST -> $sysdir/$__f"
# TODO: das kopieren in die system-verzeichnisse muss noch getestet
# werden. stimmt noch nicht so ganz.
if grep -qE "^.*$DC\s*$" <<< ${f}; then
__p="${DC_SYS_DIR}/${__f}"
log_debug "$func:${LINENO}: __m=$__m"
elif grep -qE "^.*tariff[0-9][0-9][.]json\s*$" <<< ${f}; then
__p="${TARIFF_SYS_DIR}/${__f}"
elif grep -qE "^.*[.]json\s*$" <<< ${f}; then
__p="${CONF_SYS_DIR}/${__f}"
log_debug "$func:${LINENO}: __m=$__m"
elif grep -qE "^.*[.]ini\s*$" <<< ${f}; then
if [ "$__f" = "$ATBQT_INI" ]; then
log_debug "$func:${LINENO}: __m=$__m $ATB_SYS_DIR/$__f ${f%/*}"
if grep -qE "$ATB_SYS_DIR" <<< "${f%/*}"; then
__p="$ATB_SYS_DIR/${__f}"
else
__p="$ATBAPP_SYS_DIR/${__f}"
fi
elif [ "$__f" = "$SYSTEM_CONTROL_INI" ]; then
if grep -qE "$ATB_SYS_DIR" <<< "${f%/*}"; then
__p="$ATB_SYS_DIR/${__f}"
else
__p="$SYSCONFIG_SYS_DIR/${__f}"
fi
elif [ "$__f" = "$SYS_CONFIG_INI" ]; then
if grep -qE "$ATB_SYS_DIR" <<< "${f%/*}"; then
__p="$ATB_SYS_DIR/${__f}"
else
__p="$SYSCONFIG_SYS_DIR/${__f}"
fi
elif [ "$__f" = "$ISMASMGR_INI" ]; then
if grep -qE "$ISMASMGR_SYS_DIR" <<< "${f%/*}"; then
__p="$ISMASMGR_SYS_DIR/${__f}"
elif grep -qE "$ATB_SYS_DIR" <<< "${f%/*}"; then
__p="$ATB_SYS_DIR/${__f}"
else
__p="$SYSCONFIG_SYS_DIR/${__f}"
fi
fi
fi
#if grep -qE "^.*$DC\s*$" <<< ${f}; then
# __p="${DC_SYS_DIR}/${__f}"
# log_debug "$func:${LINENO}: __m=$__m"
#elif grep -qE "^.*tariff[0-9][0-9][.]json\s*$" <<< ${f}; then
# __p="${TARIFF_SYS_DIR}/${__f}"
#elif grep -qE "^.*[.]json\s*$" <<< ${f}; then
# __p="${CONF_SYS_DIR}/${__f}"
# log_debug "$func:${LINENO}: __m=$__m"
#elif grep -qE "^.*[.]ini\s*$" <<< ${f}; then
# if [ "$__f" = "$ATBQT_INI" ]; then
# log_debug "$func:${LINENO}: __m=$__m $ATB_SYS_DIR/$__f ${f%/*}"
# if grep -qE "$ATB_SYS_DIR" <<< "${f%/*}"; then
# __p="$ATB_SYS_DIR/${__f}"
# else
# __p="$ATBAPP_SYS_DIR/${__f}"
# fi
# elif [ "$__f" = "$SYSTEM_CONTROL_INI" ]; then
# if grep -qE "$ATB_SYS_DIR" <<< "${f%/*}"; then
# __p="$ATB_SYS_DIR/${__f}"
# else
# __p="$SYSCONFIG_SYS_DIR/${__f}"
# fi
# elif [ "$__f" = "$SYS_CONFIG_INI" ]; then
# if grep -qE "$ATB_SYS_DIR" <<< "${f%/*}"; then
# __p="$ATB_SYS_DIR/${__f}"
# else
# __p="$SYSCONFIG_SYS_DIR/${__f}"
# fi
# elif [ "$__f" = "$ISMASMGR_INI" ]; then
# if grep -qE "$ISMASMGR_SYS_DIR" <<< "${f%/*}"; then
# __p="$ISMASMGR_SYS_DIR/${__f}"
# elif grep -qE "$ATB_SYS_DIR" <<< "${f%/*}"; then
# __p="$ATB_SYS_DIR/${__f}"
# else
# __p="$SYSCONFIG_SYS_DIR/${__f}"
# fi
# fi
#fi
echo "XXX-- __p=$__p"
if [ ! -z "$__p" ]; then
if cp "$__m" "$__p"; then