use assert-helpers
This commit is contained in:
parent
da32f34b4e
commit
a884019431
283
read_config
283
read_config
@ -2,6 +2,7 @@
|
|||||||
# set -x
|
# set -x
|
||||||
|
|
||||||
source ./log_helpers
|
source ./log_helpers
|
||||||
|
source ./general_utils
|
||||||
|
|
||||||
if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||||
readonly read_config_sourced=${BASH_SOURCE[0]}
|
readonly read_config_sourced=${BASH_SOURCE[0]}
|
||||||
@ -45,6 +46,7 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
|
|
||||||
local readonly cf="$CONFIGFILENAME"
|
local readonly cf="$CONFIGFILENAME"
|
||||||
|
|
||||||
|
### TODO: wieso wird hier in das verzeichnis gewechselt
|
||||||
if cd $WORKING_DIRECTORY ; then
|
if cd $WORKING_DIRECTORY ; then
|
||||||
log_debug "$func:${LINENO}: cd to $WORKING_DIRECTORY"
|
log_debug "$func:${LINENO}: cd to $WORKING_DIRECTORY"
|
||||||
else
|
else
|
||||||
@ -52,31 +54,17 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
readonly GIT_SSL_NO_VERIFY="$(cat "$cf" | jq -r .GIT_SSL_NO_VERIFY)"
|
readonly GIT_SSL_NO_VERIFY="$(cat "$cf" | jq -r .GIT_SSL_NO_VERIFY)"
|
||||||
if [ -z "$GIT_SSL_NO_VERIFY" ]; then
|
assert_s GIT_SSL_NO_VERIFY
|
||||||
log_fatal "$func:${LINENO} GIT_SSL_NO_VERIFY not set in $cf"
|
|
||||||
fi
|
|
||||||
log_debug "$func:${LINENO}: GIT_SSL_NO_VERIFY=$GIT_SSL_NO_VERIFY"
|
|
||||||
log_debug "$func:${LINENO}: WORKSPACE_DIR=$WORKSPACE_DIR"
|
|
||||||
|
|
||||||
readonly CUSTOMER_LOCATION=$(cat "$cf" | jq -r .customer_location)
|
readonly CUSTOMER_LOCATION=$(cat "$cf" | jq -r .customer_location)
|
||||||
if [ -z "$CUSTOMER_LOCATION" ]; then
|
assert_s CUSTOMER_LOCATION
|
||||||
log_fatal "$func:${LINENO}: CUSTOMER_LOCATION not set in $cf"
|
|
||||||
fi
|
|
||||||
log_debug "$func:${LINENO}: customer-location=$CUSTOMER_LOCATION"
|
|
||||||
|
|
||||||
readonly CUST_ID="$(cat "$cf" | jq -r .customer_id)"
|
readonly CUSTOMER_ID="$(cat "$cf" | jq -r .customer_id)"
|
||||||
if [ -z "$CUST_ID" ]; then
|
assert_s CUSTOMER_ID
|
||||||
log_fatal "$func:${LINENO} CUST_ID not set in $cf"
|
|
||||||
fi
|
|
||||||
readonly CUSTOMER_ID="customer_$CUST_ID"
|
|
||||||
log_debug "$func:${LINENO}: CUSTOMER-ID=$CUSTOMER_ID"
|
|
||||||
|
|
||||||
local __r_path="$(cat "$cf" | jq -r .cust_repository_path)"
|
readonly CUSTOMER_REPOSITORY_PATH="$(cat "$cf" |
|
||||||
if [ -z "$__r_path" ]; then
|
jq -r .cust_repository_path)"
|
||||||
log_fatal "$func:${LINENO}: customer repository path not set in $cf"
|
assert_s CUSTOMER_REPOSITORY_PATH
|
||||||
fi
|
|
||||||
readonly CUSTOMER_REPOSITORY_PATH="${__r_path}/${CUSTOMER_ID}.git"
|
|
||||||
log_debug "$func:${LINENO}: customer-r-path=$CUSTOMER_REPOSITORY_PATH"
|
|
||||||
|
|
||||||
local __number_of_zone_groups=$(cat "$cf" |
|
local __number_of_zone_groups=$(cat "$cf" |
|
||||||
jq -r .zg[0] |
|
jq -r .zg[0] |
|
||||||
@ -94,9 +82,7 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
done
|
done
|
||||||
|
|
||||||
readonly ZONE_GROUPS=(${__zone_groups[@]})
|
readonly ZONE_GROUPS=(${__zone_groups[@]})
|
||||||
log_debug "$func:${LINENO}: ZONE_GROUPS=${ZONE_GROUPS[@]}"
|
assert_a ZONE_GROUPS
|
||||||
|
|
||||||
log_debug "$func:${LINENO}: reading ${wd} done"
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -108,27 +94,24 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
|
|
||||||
local __customer_id_base_dir="$WORKING_DIRECTORY/${WORKSPACE_DIR}"
|
local __customer_id_base_dir="$WORKING_DIRECTORY/${WORKSPACE_DIR}"
|
||||||
readonly CUSTOMER_ID_BASE_DIR="${__customer_id_base_dir}/${CUSTOMER_ID}"
|
readonly CUSTOMER_ID_BASE_DIR="${__customer_id_base_dir}/${CUSTOMER_ID}"
|
||||||
|
assert_d CUSTOMER_ID_BASE_DIR
|
||||||
log_debug "$func:${LINENO}: CUSTOMER_ID_BASE_DIR="
|
|
||||||
log_debug "$func:${LINENO}: $CUSTOMER_ID_BASE_DIR"
|
|
||||||
|
|
||||||
CUSTOMER_LOCATION_DIR="${CUSTOMER_ID_BASE_DIR}/${CUSTOMER_LOCATION}"
|
CUSTOMER_LOCATION_DIR="${CUSTOMER_ID_BASE_DIR}/${CUSTOMER_LOCATION}"
|
||||||
|
assert_d CUSTOMER_LOCATION_DIR
|
||||||
log_debug "$func:${LINENO}: CUSTOMER_LOCATION_DIR="
|
|
||||||
log_debug "$func:${LINENO}: $CUSTOMER_LOCATION_DIR"
|
|
||||||
|
|
||||||
readonly UPDATE_CONF="${CUSTOMER_LOCATION_DIR}/update.conf"
|
readonly UPDATE_CONF="${CUSTOMER_LOCATION_DIR}/update.conf"
|
||||||
log_debug "$func:${LINENO}: UPDATE.CONF=$UPDATE_CONF"
|
assert_f UPDATE_CONF
|
||||||
|
|
||||||
readonly DC="dc2c.hex"
|
readonly DC="dc2c.hex"
|
||||||
readonly DC_SYS_DIR="/etc/dc"
|
readonly DC_SYS_DIR="/etc/dc"
|
||||||
|
readonly DC_SYS_DC_FULL="${DC_SYS_DIR}/$DC"
|
||||||
|
assert_d DC_SYS_DIR
|
||||||
|
assert_f DC_SYS_DC_FULL
|
||||||
|
|
||||||
readonly DC_DIR="${CUSTOMER_LOCATION_DIR}/dc"
|
readonly DC_DIR="${CUSTOMER_LOCATION_DIR}/dc"
|
||||||
readonly DC_FULL="${DC_DIR}/$DC"
|
readonly DC_FULL="${DC_DIR}/$DC"
|
||||||
if [ -f "$DC_FULL" ]; then
|
assert_d DC_DIR
|
||||||
log_debug "$func:${LINENO}: d2dc.hex=$DC_FULL"
|
assert_f DC_FULL
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $DC_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# readonly zone_groups=(${__zone_groups[@]})
|
# readonly zone_groups=(${__zone_groups[@]})
|
||||||
# by now (03.03.2023) there is only one zone group.
|
# by now (03.03.2023) there is only one zone group.
|
||||||
@ -147,231 +130,115 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
done
|
done
|
||||||
|
|
||||||
readonly CUSTOMER_BASE_DIRS=(${__customer_base_dirs[@]})
|
readonly CUSTOMER_BASE_DIRS=(${__customer_base_dirs[@]})
|
||||||
|
assert_a CUSTOMER_BASE_DIRS
|
||||||
if [ ${#CUSTOMER_BASE_DIRS[@]} -eq 0 ]; then
|
|
||||||
log_fatal "$func:${LINENO}: CUSTOMER_BASE_DIRS empty"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# TODO: falls mehrere gruppen/zonen auftauchen hier anpassen
|
# TODO: falls mehrere gruppen/zonen auftauchen hier anpassen
|
||||||
# TODO
|
# TODO
|
||||||
readonly ZONE=1
|
readonly ZONE=1
|
||||||
readonly CUSTOMER_BASE_DIR="${CUSTOMER_BASE_DIRS[$ZONE]}"
|
readonly CUSTOMER_BASE_DIR="${CUSTOMER_BASE_DIRS[$ZONE]}"
|
||||||
if [ -d "$CUSTOMER_BASE_DIR" ]; then
|
assert_d CUSTOMER_BASE_DIR
|
||||||
log_debug "$func:${LINENO}: CUSTOMER-BASE-DIR="
|
|
||||||
log_debug "$func:${LINENO}: $CUSTOMER_BASE_DIR"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $CUSTOMER_BASE_DIR does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly psa_config_dir="${CUSTOMER_BASE_DIR}/etc/psa_config"
|
readonly PSA_CONFIG_DIR="${CUSTOMER_BASE_DIR}/etc/psa_config"
|
||||||
if [ -d "$psa_config_dir" ]; then
|
assert_d PSA_CONFIG_DIR
|
||||||
log_debug "$func:${LINENO}: psa_config_dir="
|
|
||||||
log_debug "$func:${LINENO}: $psa_config_dir"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $psa_config_dir does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly psa_update_dir="${CUSTOMER_BASE_DIR}/etc/psa_update"
|
readonly PSA_UPDATE_DIR="${CUSTOMER_BASE_DIR}/etc/psa_update"
|
||||||
if [ -d "$psa_update_dir" ]; then
|
assert_d PSA_UPDATE_DIR
|
||||||
log_debug "$func:${LINENO}: psa_update_dir="
|
|
||||||
log_debug "$func:${LINENO}: $psa_update_dir"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $psa_update_dir does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly ATB_SYS_DIR="/etc/atb"
|
readonly ATB_SYS_DIR="/etc/atb"
|
||||||
readonly PSA_ATB_SYS_DIR="${CUSTOMER_BASE_DIR}${ATB_SYS_DIR}"
|
assert_d ATB_SYS_DIR
|
||||||
if [ -d "$PSA_ATB_SYS_DIR" ]; then
|
|
||||||
log_debug "$func:${LINENO}: PSA_ATB_SYS_DIR=$PSA_ATB_SYS_DIR"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $PSA_ATB_SYS_DIR does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly psa_base_ini_dir="${CUSTOMER_BASE_DIR}/opt/app"
|
readonly PSA_ATB_SYS_DIR="${CUSTOMER_BASE_DIR}${ATB_SYS_DIR}"
|
||||||
if [ -d "$psa_base_ini_dir" ]; then
|
assert_d PSA_ATB_SYS_DIR
|
||||||
log_debug "$func:${LINENO}: psa_base_ini_dir="
|
|
||||||
log_debug "$func:${LINENO}: $psa_base_ini_dir"
|
readonly PSA_BASE_INI_DIR="${CUSTOMER_BASE_DIR}/opt/app"
|
||||||
else
|
assert_d PSA_BASE_INI_DIR
|
||||||
log_fatal "$func:${LINENO}: $psa_base_ini_dir does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly SYSCONFIG_SYS_DIR="/opt/app/sysconfig"
|
readonly SYSCONFIG_SYS_DIR="/opt/app/sysconfig"
|
||||||
readonly PSA_SYSCONFIG_DIR="$CUSTOMER_BASE_DIR$SYSCONFIG_SYS_DIR"
|
assert_d SYSCONFIG_SYS_DIR
|
||||||
# if [ -d "$psa_syconfig_dir" ]; DOES NOT WORK !!!
|
|
||||||
if ls -al $PSA_SYSCONFIG_DIR > /dev/null; then
|
|
||||||
log_debug "$func:${LINENO}: PSA_SYSCONFIG_DIR="
|
|
||||||
log_debug "$func:${LINENO}: $PSA_SYSCONFIG_DIR"
|
|
||||||
else
|
|
||||||
log_error "$func:${LINENO}: $PSA_SYSCONFIG_DIR does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly psa_ismasmgr_dir="${psa_base_ini_dir}/ISMASMgr"
|
readonly PSA_SYSCONFIG_DIR="${CUSTOMER_BASE_DIR}${SYSCONFIG_SYS_DIR}"
|
||||||
if [ -d "$psa_ismasmgr_dir" ]; then
|
assert_d PSA_SYSCONFIG_DIR
|
||||||
log_debug "$func:${LINENO}: psa_ismasmgr_dir="
|
|
||||||
log_debug "$func:${LINENO}: $psa_ismasmgr_dir"
|
readonly PSA_ISMASMGR_DIR="${PSA_BASE_INI_DIR}/ISMASMgr"
|
||||||
else
|
assert_d PSA_ISMASMGR_DIR
|
||||||
log_fatal "$func:${LINENO}: $psa_ismasmgr_dir does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly CONF_SYS_DIR="/etc/psa_config"
|
readonly CONF_SYS_DIR="/etc/psa_config"
|
||||||
readonly OPKG_SYS_DIR="/etc/psa_update"
|
assert_d CONF_SYS_DIR
|
||||||
readonly ATBAPP_SYS_DIR="/opt/app/ATBAPP"
|
|
||||||
|
|
||||||
readonly psa_atbqt_dir="$CUSTOMER_BASE_DIR$ATBAPP_SYS_DIR"
|
readonly OPKG_SYS_DIR="/etc/psa_update"
|
||||||
if [ -d "$psa_atbqt_dir" ]; then
|
assert_d OPKG_SYS_DIR
|
||||||
log_debug "$func:${LINENO}: psa_atbqt_dir="
|
|
||||||
log_debug "$func:${LINENO}: $psa_atbqt_dir"
|
readonly ATBAPP_SYS_DIR="/opt/app/ATBAPP"
|
||||||
else
|
assert_d ATBAPP_SYS_DIR
|
||||||
log_fatal "$func:${LINENO}: $psa_atbqt_dir does not exist"
|
|
||||||
fi
|
readonly PSA_ATBQT_DIR="$CUSTOMER_BASE_DIR$ATBAPP_SYS_DIR"
|
||||||
|
assert_d PSA_ATBQT_DIR
|
||||||
|
|
||||||
readonly TARIFF_CURRENT="tariff.current"
|
readonly TARIFF_CURRENT="tariff.current"
|
||||||
readonly TARIFF_CURRENT_FULL="${psa_atbqt_dir}/$TARIFF_CURRENT"
|
readonly TARIFF_CURRENT_FULL="${PSA_ATBQT_DIR}/$TARIFF_CURRENT"
|
||||||
if [ -f "$TARIFF_CURRENT_FULL" ]; then
|
assert_f TARIFF_CURRENT_FULL
|
||||||
log_debug "$func:${LINENO}: tariff.current="
|
|
||||||
log_debug "$func:${LINENO}: $TARIFF_CURRENT_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $TARIFF_CURRENT_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly ATBQT_INI="ATBQT.ini"
|
readonly ATBQT_INI="ATBQT.ini"
|
||||||
readonly ATBQT_INI_FULL="${psa_atbqt_dir}/$ATBQT_INI"
|
readonly ATBQT_INI_FULL="${PSA_ATBQT_DIR}/$ATBQT_INI"
|
||||||
if [ -f "$ATBQT_INI_FULL" ]; then
|
assert_f ATBQT_INI_FULL
|
||||||
log_debug "$func:${LINENO}: ATBTQT.ini="
|
|
||||||
log_debug "$func:${LINENO}: $ATBQT_INI_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $ATBQT_INI_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly ATBQT="ATBQT"
|
readonly ATBQT="ATBQT"
|
||||||
readonly ATBQT_SYS_FULL="${ATBAPP_SYS_DIR}/$ATBQT"
|
readonly ATBQT_SYS_FULL="${ATBAPP_SYS_DIR}/$ATBQT"
|
||||||
if [ -f "$ATBQT_SYS_FULL" ]; then
|
assert_f ATBQT_SYS_FULL
|
||||||
log_debug "$func:${LINENO}: ATBQT="
|
|
||||||
log_debug "$func:${LINENO}: $ATBQT_SYS_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $ATBQT_SYS_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly ISMASMGR_INI="ISMASMgr.ini"
|
readonly ISMASMGR_INI="ISMASMgr.ini"
|
||||||
readonly ISMASMGR_SYS_DIR="/opt/app/ISMASMgr"
|
readonly ISMASMGR_SYS_DIR="/opt/app/ISMASMgr"
|
||||||
|
assert_d ISMASMGR_SYS_DIR
|
||||||
|
|
||||||
readonly ISMASMGR_ISMASMGR_INI_FULL="${psa_ismasmgr_dir}/$ISMASMGR_INI"
|
readonly ISMASMGR_ISMASMGR_INI_FULL="${PSA_ISMASMGR_DIR}/$ISMASMGR_INI"
|
||||||
if [ -f "$ISMASMGR_ISMASMGR_INI_FULL" ]; then
|
assert_f ISMASMGR_ISMASMGR_INI_FULL
|
||||||
log_debug "$func:${LINENO}: ismasmgr_ismasmgr.ini="
|
|
||||||
log_debug "$func:${LINENO}: $ISMASMGR_ISMASMGR_INI_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $ISMASMGR_ISMASMGR_INI_FULL "\
|
|
||||||
"does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly SYSCONFIG_ISMASMGR_INI_FULL="${PSA_SYSCONFIG_DIR}/ISMASMgr.ini"
|
readonly SYSCONFIG_ISMASMGR_INI_FULL="${PSA_SYSCONFIG_DIR}/ISMASMgr.ini"
|
||||||
if [ -f "$SYSCONFIG_ISMASMGR_INI_FULL" ]; then
|
assert_f SYSCONFIG_ISMASMGR_INI_FULL
|
||||||
log_debug "$func:${LINENO}: sysconfig_ismasmgr.ini="
|
|
||||||
log_debug "$func:${LINENO}: $SYSCONFIG_ISMASMGR_INI_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $SYSCONFIG_ISMASMGR_INI_FULL "\
|
|
||||||
"does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly ATB_ISMASMGR_INI_FULL="${PSA_ATB_SYS_DIR}/$ISMASMGR_INI"
|
readonly ATB_ISMASMGR_INI_FULL="${PSA_ATB_SYS_DIR}/$ISMASMGR_INI"
|
||||||
if [ -f "$ATB_ISMASMGR_INI_FULL" ]; then
|
assert_f ATB_ISMASMGR_INI_FULL
|
||||||
log_debug "$func:${LINENO}: atb_ismasmgr.ini="
|
|
||||||
log_debug "$func:${LINENO}: $ATB_ISMASMGR_INI_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $ATB_ISMASMGR_INI_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly SYS_CONFIG_INI="sysconfig.ini"
|
readonly SYS_CONFIG_INI="sysconfig.ini"
|
||||||
readonly __sysc_sysc_full="${PSA_SYSCONFIG_DIR}/$SYS_CONFIG_INI"
|
readonly __sysc_sysc_full="${PSA_SYSCONFIG_DIR}/$SYS_CONFIG_INI"
|
||||||
readonly SYSCONFIG_SYSCONFIG_INI_FULL="$__sysc_sysc_full"
|
readonly SYSCONFIG_SYSCONFIG_INI_FULL="$__sysc_sysc_full"
|
||||||
if [ -f "$SYSCONFIG_SYSCONFIG_INI_FULL" ]; then
|
assert_f SYSCONFIG_SYSCONFIG_INI_FULL
|
||||||
log_debug "$func:${LINENO}: sysconfig_sysconfig.ini="
|
|
||||||
log_debug "$func:${LINENO}: $SYSCONFIG_SYSCONFIG_INI_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: "\
|
|
||||||
"$SYSCONFIG_SYSCONFIG_INI_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly ATB_SYSCONFIG_INI_FULL="${PSA_ATB_SYS_DIR}/$SYS_CONFIG_INI"
|
readonly ATB_SYSCONFIG_INI_FULL="${PSA_ATB_SYS_DIR}/$SYS_CONFIG_INI"
|
||||||
if [ -f "$ATB_SYSCONFIG_INI_FULL" ]; then
|
assert_f ATB_SYSCONFIG_INI_FULL
|
||||||
log_debug "$func:${LINENO}: atb_sysconfig.ini="
|
|
||||||
log_debug "$func:${LINENO}: $ATB_SYSCONFIG_INI_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $ATB_SYSCONFIG_INI_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly "SYSTEM_CONTROL_INI"="SystemControl.ini"
|
readonly "SYSTEM_CONTROL_INI"="SystemControl.ini"
|
||||||
local __sysctrl_ini_full="${PSA_SYSCONFIG_DIR}/$SYSTEM_CONTROL_INI"
|
local __sysctrl_ini_full="${PSA_SYSCONFIG_DIR}/$SYSTEM_CONTROL_INI"
|
||||||
readonly SYSCONFIG_SYSCTRL_INI_FULL="$__sysctrl_ini_full"
|
readonly SYSCONFIG_SYSCTRL_INI_FULL="$__sysctrl_ini_full"
|
||||||
if [ -f "$SYSCONFIG_SYSCTRL_INI_FULL" ]; then
|
assert_f SYSCONFIG_SYSCTRL_INI_FULL
|
||||||
log_debug "$func:${LINENO}: sysconfig_systemcontrol.ini="
|
|
||||||
log_debug "$func:${LINENO}: $SYSCONFIG_SYSCTRL_INI_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $SYSCONFIG_SYSCTRL_INI_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly ATB_SYSCTRL_INI_FULL="${PSA_ATB_SYS_DIR}/$SYSTEM_CONTROL_INI"
|
readonly ATB_SYSCTRL_INI_FULL="${PSA_ATB_SYS_DIR}/$SYSTEM_CONTROL_INI"
|
||||||
if [ -f "$ATB_SYSCTRL_INI_FULL" ]; then
|
assert_f ATB_SYSCTRL_INI_FULL
|
||||||
log_debug "$func:${LINENO}: atb_systemcontrol.ini="
|
|
||||||
log_debug "$func:${LINENO}: $ATB_SYSCTRL_INI_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $ATB_SYSCTRL_INI_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly ATB_ATBQT_INI_FULL="${PSA_ATB_SYS_DIR}/$ATBQT_INI"
|
readonly ATB_ATBQT_INI_FULL="${PSA_ATB_SYS_DIR}/$ATBQT_INI"
|
||||||
if [ -f "$ATB_ATBQT_INI_FULL" ]; then
|
assert_f ATB_ATBQT_INI_FULL
|
||||||
log_debug "$func:${LINENO}: ATBQT.ini="
|
|
||||||
log_debug "$func:${LINENO}: $ATB_ATBQT_INI_FULL"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $ATB_ATBQT_INI_FULL does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly DC2C_SERIAL_JSON="${psa_config_dir}/DC2C_serial.json"
|
readonly DC2C_SERIAL_JSON="${PSA_CONFIG_DIR}/DC2C_serial.json"
|
||||||
if [ -f "$DC2C_SERIAL_JSON" ]; then
|
assert_f DC2C_SERIAL_JSON
|
||||||
log_debug "$func:${LINENO}: DC2C_SERIAL_JSON="
|
|
||||||
log_debug "$func:${LINENO}: $DC2C_SERIAL_JSON"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $DC2C_SERIAL_JSON does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly DC2C_CASH_JSON="${psa_config_dir}/DC2C_cash.json"
|
readonly DC2C_CASH_JSON="${PSA_CONFIG_DIR}/DC2C_cash.json"
|
||||||
if [ -f "$DC2C_CASH_JSON" ]; then
|
assert_f DC2C_CASH_JSON
|
||||||
log_debug "$func:${LINENO}: DC2C_CASH_JSON="
|
|
||||||
log_debug "$func:${LINENO}: $DC2C_CASH_JSON"
|
|
||||||
else
|
|
||||||
log_debug "$func:${LINENO}: $DC2C_CASH_JSON does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly DC2C_CONF_JSON="${psa_config_dir}/DC2C_conf.json"
|
readonly DC2C_CONF_JSON="${PSA_CONFIG_DIR}/DC2C_conf.json"
|
||||||
if [ -f "$DC2C_CONF_JSON" ]; then
|
assert_f DC2C_CONF_JSON
|
||||||
log_debug "$func:${LINENO}: DC2C_CONF_JSON="
|
|
||||||
log_debug "$func:${LINENO}: $DC2C_CONF_JSON"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $DC2C_CONF_JSON does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local DC2C_PRINT_JSON=()
|
local DC2C_PRINT_JSON=()
|
||||||
for i in {1..32}; do # up to 32 print-json-files
|
for i in {1..32}; do # up to 32 print-json-files
|
||||||
local __f=${psa_config_dir}/DC2C_print$(printf "%02d" $i).json
|
local __f=${PSA_CONFIG_DIR}/DC2C_print$(printf "%02d" $i).json
|
||||||
readonly DC2C_PRINT$(printf "%02d" $i)_JSON=$__f
|
readonly DC2C_PRINT$(printf "%02d" $i)_JSON=$__f
|
||||||
# local __g=$(eval echo '$'DC2C_PRINT$(printf "%02d" $i)_JSON)
|
# local __g=$(eval echo '$'DC2C_PRINT$(printf "%02d" $i)_JSON)
|
||||||
if [ -f $__f ]; then
|
assert_f DC2C_PRINT$(printf "%02d" $i)_JSON
|
||||||
log_debug "$func:${LINENO}: DC2C_PRINT$(printf "%02d" $i)_JSON="
|
|
||||||
log_debug "$func:${LINENO}: $__f"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $__f does not exist"
|
|
||||||
fi
|
|
||||||
DC2C_PRINT_JSON+=($__f)
|
DC2C_PRINT_JSON+=($__f)
|
||||||
done
|
done
|
||||||
|
|
||||||
readonly opkg_cmds_file="${psa_update_dir}/opkg_commands"
|
readonly OPKG_CMDS_FILE="${PSA_UPDATE_DIR}/opkg_commands"
|
||||||
if [ -f "$opkg_cmds_file" ]; then
|
assert_f OPKG_CMDS_FILE
|
||||||
log_debug "$func:${LINENO}: opkg_commands="
|
|
||||||
log_debug "$func:${LINENO}: $opkg_cmds_file"
|
|
||||||
else
|
|
||||||
log_fatal "$func:${LINENO}: $opkg_cmds_file does not exist"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# TODO: anpassen, da z.B. fuer szeged mehrere zonen vorhanden sind
|
# TODO: anpassen, da z.B. fuer szeged mehrere zonen vorhanden sind
|
||||||
readonly KNOWN_CONF_FILES=(${CUSTOMER_LOCATION}/update.conf \
|
readonly KNOWN_CONF_FILES=(${CUSTOMER_LOCATION}/update.conf \
|
||||||
@ -392,14 +259,14 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
|||||||
|
|
||||||
readonly KNOWN_FILES=(${KNOWN_CONF_FILES[@]} \
|
readonly KNOWN_FILES=(${KNOWN_CONF_FILES[@]} \
|
||||||
${KNOWN_INI_FILES[@]} \
|
${KNOWN_INI_FILES[@]} \
|
||||||
${opkg_cmds_file##*${CUSTOMER_ID}/})
|
${OPKG_CMDS_FILE##*${CUSTOMER_ID}/})
|
||||||
|
|
||||||
log_debug "$func:${LINENO}: known conf/ini_files ->"
|
log_debug "known conf/ini_files ->"
|
||||||
for (( i=0; i < ${#KNOWN_FILES[@]}; ++i )); do
|
for (( i=0; i < ${#KNOWN_FILES[@]}; ++i )); do
|
||||||
tab=$'\t'
|
tab=$'\t'
|
||||||
log_debug "$func:${LINENO}: $tab$tab ${KNOWN_FILES[$i]}"
|
log_debug "$tab$tab ${KNOWN_FILES[$i]}"
|
||||||
done
|
done
|
||||||
log_debug "$func:${LINENO}: sanity of ${CUSTOMER_REPOSITORY_PATH} OK"
|
log_debug "sanity of ${CUSTOMER_REPOSITORY_PATH} OK"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user