Compare commits

..

No commits in common. "e46f5962705ef5f8f6ae1f3b85e47fb2ced680d3" and "ba1f70fec4719f028de76269901a08742ea31e9f" have entirely different histories.

2 changed files with 78 additions and 106 deletions

View File

@ -112,7 +112,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
assert_d CUSTOMER_ID_BASE_DIR assert_d CUSTOMER_ID_BASE_DIR
CUSTOMER_LOCATION_DIR="${CUSTOMER_ID_BASE_DIR}/${CUSTOMER_LOCATION}" CUSTOMER_LOCATION_DIR="${CUSTOMER_ID_BASE_DIR}/${CUSTOMER_LOCATION}"
CUST_LOC_DIR=$CUSTOMER_LOCATION_DIR
assert_d CUSTOMER_LOCATION_DIR assert_d CUSTOMER_LOCATION_DIR
# readonly zone_groups=(${__zone_groups[@]}) # readonly zone_groups=(${__zone_groups[@]})
@ -144,7 +143,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
# TODO # TODO
# Zone aus /etc/zone_nr auslesen # Zone aus /etc/zone_nr auslesen
# #
readonly ZONE_GROUP=1
readonly ZONE=1 readonly ZONE=1
readonly CUST_BASE_DIR="${CUST_BASE_DIRS[$ZONE]}" readonly CUST_BASE_DIR="${CUST_BASE_DIRS[$ZONE]}"
assert_d CUST_BASE_DIR assert_d CUST_BASE_DIR
@ -205,9 +203,10 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
readonly DC2C_SYS_CONF_JSON="${CONF_SYS_DIR}/DC2C_conf.json" readonly DC2C_SYS_CONF_JSON="${CONF_SYS_DIR}/DC2C_conf.json"
readonly DC_PSA_DC_FILE="${DC_PSA_DIR}/$DC" readonly DC_PSA_DC_FILE="${DC_PSA_DIR}/$DC"
readonly ATBQT_ATB_PSA_INI_FILE="${ATB_PSA_DIR}/$ATBQT_INI" readonly ATBQT_ATB_PSA_BIN_FILE="${ATBAPP_PSA_DIR}/$ATBQT_BIN"
readonly ATBQT_APP_PSA_INI_FILE="${ATBAPP_PSA_DIR}/$ATBQT_INI" readonly ATBQT_ATB_PSA_INI_FILE="${ATB_SYS_DIR}/$ATBQT_INI"
readonly ATBQT_ETC_PSA_INI_FILE="${ETC_PSA_DIR}/$ATBQT_INI" readonly ATBQT_APP_PSA_INI_FILE="${ATBAPP_SYS_DIR}/$ATBQT_INI"
readonly ATBQT_ETC_PSA_INI_FILE="${ETC_SYS_DIR}/$ATBQT_INI"
readonly ISMASMGRATB_PSA_INI_FILE="${ATB_PSA_DIR}/$ISMASMGR_INI" readonly ISMASMGRATB_PSA_INI_FILE="${ATB_PSA_DIR}/$ISMASMGR_INI"
readonly ISMASMGRAPP_PSA_INI_FILE="${ISMASMGR_PSA_DIR}/$ISMASMGR_INI" readonly ISMASMGRAPP_PSA_INI_FILE="${ISMASMGR_PSA_DIR}/$ISMASMGR_INI"
readonly ISMASMGRETC_PSA_INI_FILE="${ETC_PSA_DIR}/$ISMASMGR_INI" readonly ISMASMGRETC_PSA_INI_FILE="${ETC_PSA_DIR}/$ISMASMGR_INI"
@ -215,9 +214,9 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
readonly SYSCONF_ETC_PSA_INI_FILE="${ETC_PSA_DIR}/$SYSCONF_INI" readonly SYSCONF_ETC_PSA_INI_FILE="${ETC_PSA_DIR}/$SYSCONF_INI"
readonly SYSCONF_ATB_PSA_INI_FILE="${ATB_PSA_DIR}/$SYSCONF_INI" readonly SYSCONF_ATB_PSA_INI_FILE="${ATB_PSA_DIR}/$SYSCONF_INI"
readonly SYSCONF_SCF_PSA_INI_FILE="${SYSCONFIG_PSA_DIR}/$SYSCONF_INI" readonly SYSCONF_SCF_PSA_INI_FILE="${SYSCONFIG_PSA_DIR}/$SYSCONF_INI"
readonly SYSCTRL_ETC_PSA_INI_FILE="${ETC_PSA_DIR}/$SYSCTRL_INI" readonly SYSCTRL_ETC_PSA_INI_FILE="${ETC_SYS_DIR}/$SYSCTRL_INI"
readonly SYSCTRL_ATB_PSA_INI_FILE="${ATB_PSA_DIR}/$SYSCTRL_INI" readonly SYSCTRL_ATB_PSA_INI_FILE="${ATB_SYS_DIR}/$SYSCTRL_INI"
readonly SYSCTRL_SCF_PSA_INI_FILE="${SYSCONFIG_PSA_DIR}/$SYSCTRL_INI" readonly SYSCTRL_SCF_PSA_INI_FILE="${SYSCONFIG_SYS_DIR}/$SYSCTRL_INI"
readonly OPKG_CMDS_PSA_FILE="${OPKG_PSA_DIR}/opkg_commands" readonly OPKG_CMDS_PSA_FILE="${OPKG_PSA_DIR}/opkg_commands"
readonly TC_PSA_TC_FILE="${ATBAPP_PSA_DIR}/$TARIFF_CURRENT" readonly TC_PSA_TC_FILE="${ATBAPP_PSA_DIR}/$TARIFF_CURRENT"
readonly PSA_UPDATE_CONF="${CUSTOMER_LOCATION_DIR}/update.conf" readonly PSA_UPDATE_CONF="${CUSTOMER_LOCATION_DIR}/update.conf"
@ -273,6 +272,7 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
assert_f DC2C_SYS_CASH_JSON assert_f DC2C_SYS_CASH_JSON
assert_f DC_PSA_DC_FILE assert_f DC_PSA_DC_FILE
# assert_f ATBQT_ATB_PSA_BIN_FILE
assert_f ATBQT_ATB_PSA_INI_FILE assert_f ATBQT_ATB_PSA_INI_FILE
assert_f ATBQT_APP_PSA_INI_FILE assert_f ATBQT_APP_PSA_INI_FILE
assert_f ATBQT_ETC_PSA_INI_FILE assert_f ATBQT_ETC_PSA_INI_FILE
@ -347,10 +347,9 @@ 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[@]} \
${DC_PSA_DC_FILE##*${CUSTOMER_ID}/} \
${OPKG_CMDS_PSA_FILE##*${CUSTOMER_ID}/}) ${OPKG_CMDS_PSA_FILE##*${CUSTOMER_ID}/})
log_debug "known json/ini/hex_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 "$tab$tab ${KNOWN_FILES[$i]}" log_debug "$tab$tab ${KNOWN_FILES[$i]}"

View File

@ -42,10 +42,6 @@ copy () {
continue continue
fi fi
# macht fuer dc keinen sinn
# local sysdir=$(echo $f |
# sed -E -e s'=(.*szeged/[0-9]/[0-9])(.*)(/.*)=\2=g')
copy_necessary=1 copy_necessary=1
PERCENT=$((PERCENT+1)) PERCENT=$((PERCENT+1))
@ -55,13 +51,11 @@ copy () {
local readonly __m="${CUSTOMER_ID_BASE_DIR}/${f}" local readonly __m="${CUSTOMER_ID_BASE_DIR}/${f}"
local __p="" local __p=""
# echo "TEST -> $sysdir/$__f"
if grep -qE "^.*$DC\s*$" <<< ${f}; then if grep -qE "^.*$DC\s*$" <<< ${f}; then
__p="${DC_SYS_DIR}/${__f}" __p=" ${DC_SYS_DIR}/${__f}"
log_debug "$func:${LINENO}: __m=$__m" log_debug "$func:${LINENO}: __m=$__m"
elif grep -qE "^.*[.]json\s*$" <<< ${f}; then elif grep -qE "^.*[.]json\s*$" <<< ${f}; then
__p="${CONF_SYS_DIR}/${__f}" __p=" ${CONF_SYS_DIR}/${__f}"
log_debug "$func:${LINENO}: __m=$__m" log_debug "$func:${LINENO}: __m=$__m"
elif grep -qE "^.*[.]ini\s*$" <<< ${f}; then elif grep -qE "^.*[.]ini\s*$" <<< ${f}; then
if [ "$__f" = "$ATBQT_INI" ]; then if [ "$__f" = "$ATBQT_INI" ]; then
@ -164,93 +158,72 @@ check_md5_for_changed_json_and_ini_files () {
readarray -td' ' files <<< "$1" readarray -td' ' files <<< "$1"
local readonly __cl=$CUSTOMER_LOCATION local readonly __cl=$CUSTOMER_LOCATION
for file in ${files[@]}; do for file in ${files[@]}; do
# .../szeged/1/1...
log_debug "$func:${LINENO} checking file=${file}..." log_debug "$func:${LINENO} checking file=${file}..."
local __fs=${file##*.} local __fsuffix=${file##*.}
# local __bn=$(basename $file .$__fsuffix) local __bn=$(basename $file .$__fsuffix)
# local __key_suffix=$(echo $file | if [[ "$file" =~ .*dc2c.hex.* ]]; then
# sed -E -e 's=(.*[0-9]/[0-9])([^.]+)(.*)=\2=g' -e 's=/=.=g') js_key=".dc.dc2c.$__bn"
js_key=""
case $file in
*.ini | *.json | *.hex)
set -x
local __key_suffix=$(echo $file |
sed -E -e 's=(.*[0-9]/[0-9])([^.]+)(.*)=\2=g' -e 's=/=.=g')
js_key=".$__fs.$__cl.zg[$ZONE_GROUP].z[$ZONE]$__key_suffix"
md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)" md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)"
set +x elif [[ "$file" =~ .*cash[.]json.* ]]; then
js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.$__bn"
md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
;; md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)"
# *.hex) elif [[ "$file" =~ .*print[0-9][0-9][.]json.* ]]; then
# js_key=$(echo $file | js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.$__bn"
# sed -E -e 's=(.*szeged)([^.]+)(.*)=\2=g' -e 's=/=.=g') md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)"
# md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)" elif [[ "$file" =~ .*conf[.]json.* ]]; then
# ;; js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.DC2C_conf"
*) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
log_crit "$func:${LINENO} unknown file=${file}" md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)"
;; elif [[ "$file" =~ .*serial[.]json.* ]]; then
esac js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.DC2C_serial"
md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
#if [[ "$file" =~ .*dc2c.hex.* ]]; then md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)"
# js_key=$(echo $file | elif [[ "$file" =~ .*atb/ATBQT[.]ini.* ]]; then
# sed -E -e 's=(.*$CUSTOMER_LOCATION)([^.]+)(.*)=\2=g' js_key=".ini.$__cl.zg[1].z[1].etc.atb.ATBQT"
# -e 's=/=.=g') md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) md5sum_repository="$(md5_of $ATB_ATBQT_INI_FULL)"
# md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)" elif [[ "$file" =~ .*ATBQT[.]ini.* ]]; then
#else js_key=".ini.$__cl.zg[1].z[1].opt.app.ATBAPP.ATBQT"
# if [[ "$file" =~ .*cash[.]json.* ]]; then md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# js_key=".ini.$__cl.zg[$ZONE_GROUP].z[$ZONE]$__key_suffix" md5sum_repository="$(md5_of $ATBQT_INI_FULL)"
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) elif [[ "$file" =~ .*atb/sysconfig[.]ini.* ]]; then
# md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)" js_key=".ini.$__cl.zg[1].z[1].etc.atb.sysconfig"
# elif [[ "$file" =~ .*print[0-9][0-9][.]json.* ]]; then md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# js_key=".ini.$__cl.zg[$ZONE_GROUP].z[$ZONE]$__key_suffix" md5sum_repository="$(md5_of $ATB_SYSCONFIG_INI_FULL)"
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) elif [[ "$file" =~ .*sysconfig[.]ini.* ]]; then
# md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)" js_key=".ini.$__cl.zg[1].z[1].opt.app.sysconfig.sysconfig"
# elif [[ "$file" =~ .*conf[.]json.* ]]; then md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# js_key=".ini.$__cl.zg[$ZONE_GROUP].z[$ZONE]$__key_suffix" md5sum_repository=$(md5_of $SYSCONFIG_SYSCONFIG_INI_FULL)
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) elif [[ "$file" =~ .*atb/SystemControl[.]ini.* ]]; then
# md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)" js_key=".ini.$__cl.zg[1].z[1].etc.atb.SystemControl"
# elif [[ "$file" =~ .*serial[.]json.* ]]; then md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# js_key=".ini.$__cl.zg[$ZONE_GROUP].z[$ZONE]$__key_suffix" md5sum_repository="$(md5_of $ATB_SYSCTRL_INI_FULL)"
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) elif [[ "$file" =~ .*SystemControl[.]ini.* ]]; then
# md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)" js_key=".ini.$__cl.zg[1].z[1].opt.app.sysconfig.SystemControl"
#################################################################### md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
## ATBQT.ini md5sum_repository=$(md5_of $SYSCONFIG_SYSCTRL_INI_FULL)
#################################################################### elif [[ "$file" =~ .*atb/ISMASMgr[.]ini.* ]]; then
# elif [[ "$file" =~ .*/$ATBQT_INI.* ]]; then js_key=".ini.$__cl.zg[1].z[1].etc.atb.ISMASMgr"
# js_key=".ini.$__cl.zg[$ZONE_GROUP].z[$ZONE]$__key_suffix" md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) md5sum_repository="$(md5_of $ATB_ISMASMGR_INI_FULL)"
# md5sum_repository=$(md5_of $CUSTOMER_ID_BASE_DIR/$file) elif [[ "$file" =~ .*etc/ISMASMgr[.]ini.* ]]; then
#################################################################### js_key=".ini.$__cl.zg[1].z[1].etc.ISMASMgr"
## sysconfig.ini md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
#################################################################### md5sum_repository="$(md5_of $ATB_ISMASMGR_INI_FULL)"
# elif [[ "$file" =~ .*/$SYSCONF_INI.* ]]; then elif [[ "$file" =~ .*ISMASMgr/ISMASMgr[.]ini.* ]]; then
# js_key=".ini.$__cl.zg[$ZONE_GROUP].z[$ZONE]$__key_suffix" js_key=".ini.$__cl.zg[1].z[1].opt.app.ISMASMgr.ISMASMgr"
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# md5sum_repository=$(md5_of $CUSTOMER_ID_BASE_DIR/$file) md5sum_repository=$(md5_of $ISMASMGR_ISMASMGR_INI_FULL)
#################################################################### elif [[ "$file" =~ .*sysconfig/ISMASMgr[.]ini.* ]]; then
## SystemControl.ini js_key=".ini.$__cl.zg[1].z[1].opt.app.sysconfig.ISMASMgr"
#################################################################### md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# elif [[ "$file" =~ .*/$SYSCTRL_INI.* ]]; then md5sum_repository=$(md5_of $SYSCONFIG_ISMASMGR_INI_FULL)
# js_key=".ini.$__cl.zg[$ZONE_GROUP].z[$ZONE]$__key_suffix" else
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key) continue
# md5sum_repository=$(md5_of $CUSTOMER_ID_BASE_DIR/$file) fi
####################################################################
## ISMASMgr.ini
####################################################################
# elif [[ "$file" =~ .*/$ISMASMMGR_INI.* ]]; then
# js_key=".ini.$__cl.zg[$ZONE_GROUP].z[$ZONE]$__key_suffix"
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
# md5sum_repository=$(md5_of $CUSTOMER_ID_BASE_DIR/$file)
# fi
#fi
test -z $js_key && continue
PERCENT=$((PERCENT+1)) PERCENT=$((PERCENT+1))
test $PERCENT -gt 100 && PERCENT=100 test $PERCENT -gt 100 && PERCENT=100