Compare commits
No commits in common. "73a18d5615bded1c9e6e491e29af65c944647466" and "e46f5962705ef5f8f6ae1f3b85e47fb2ced680d3" have entirely different histories.
73a18d5615
...
e46f596270
20
read_config
20
read_config
@ -145,14 +145,14 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
# Zone aus /etc/zone_nr auslesen
|
||||
#
|
||||
readonly ZONE_GROUP=1
|
||||
readonly ZONE=2
|
||||
readonly ZONE=1
|
||||
readonly CUST_BASE_DIR="${CUST_BASE_DIRS[$ZONE]}"
|
||||
assert_d CUST_BASE_DIR
|
||||
|
||||
readonly ETC_SYS_DIR="/etc"
|
||||
readonly ATB_SYS_DIR="/etc/atb"
|
||||
readonly DC_SYS_DIR="/etc/dc"
|
||||
readonly TARIFF_SYS_DIR="/etc/psa_tariff"
|
||||
readonly TARIFF_SYS_DIR="/etc/tariff"
|
||||
readonly OPKG_SYS_DIR="/etc/psa_update"
|
||||
readonly CONF_SYS_DIR="/etc/psa_config"
|
||||
readonly OPT_SYS_DIR="/opt"
|
||||
@ -180,8 +180,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
readonly SYSCTRL_INI="SystemControl.ini"
|
||||
readonly TARIFF_CURRENT="tariff.current"
|
||||
readonly DC="dc2c.hex"
|
||||
readonly TARIFF_SUMMER="summer_tariff.json"
|
||||
readonly TARIFF_WINTER="winter_tariff.json"
|
||||
|
||||
readonly DC_SYS_DC_FILE="${DC_SYS_DIR}/$DC"
|
||||
readonly ATBQT_ATB_SYS_BIN_FILE="${ATBAPP_SYS_DIR}/$ATBQT_BIN"
|
||||
@ -206,8 +204,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
readonly DC2C_SYS_CASH_JSON="${CONF_SYS_DIR}/DC2C_cash.json"
|
||||
readonly DC2C_SYS_CONF_JSON="${CONF_SYS_DIR}/DC2C_conf.json"
|
||||
readonly DC_PSA_DC_FILE="${DC_PSA_DIR}/$DC"
|
||||
readonly TARIFF_SYS_SUMMER="${TARIFF_SYS_DIR}${TARIFF_SUMMER}"
|
||||
readonly TARIFF_SYS_WINTER="${TARIFF_SYS_DIR}${TARIFF_WINTER}"
|
||||
|
||||
readonly ATBQT_ATB_PSA_INI_FILE="${ATB_PSA_DIR}/$ATBQT_INI"
|
||||
readonly ATBQT_APP_PSA_INI_FILE="${ATBAPP_PSA_DIR}/$ATBQT_INI"
|
||||
@ -323,25 +319,16 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
for i in {1..32}; do # up to 32 print-json-files
|
||||
local __f=${CONF_PSA_DIR}/DC2C_print$(printf "%02d" $i).json
|
||||
readonly DC2C_PRINT$(printf "%02d" $i)_JSON=$__f
|
||||
# local __g=$(eval echo '$'DC2C_PRINT$(printf "%02d" $i)_JSON)
|
||||
assert_f DC2C_PRINT$(printf "%02d" $i)_JSON
|
||||
DC2C_PRINT_JSON+=($__f)
|
||||
done
|
||||
|
||||
local TARIFF_FILES_JSON=()
|
||||
for i in {1..32}; do # up to 32 tariff-json-files
|
||||
local __f=${TARIFF_PSA_DIR}/tariff$(printf "%02d" $i).json
|
||||
readonly TARIFF$(printf "%02d" $i)_JSON=$__f
|
||||
assert_f TARIFF$(printf "%02d" $i)_JSON
|
||||
TARIFF_FILES_JSON+=($__f)
|
||||
done
|
||||
|
||||
readonly KNOWN_CONF_FILES=(${CUSTOMER_LOCATION}/update.conf \
|
||||
${DC2C_PRINT_JSON[@]##*${CUSTOMER_ID}/} \
|
||||
${DC2C_PSA_CONF_JSON##*${CUSTOMER_ID}/} \
|
||||
${DC2C_PSA_CASH_JSON##*${CUSTOMER_ID}/} \
|
||||
${DC2C_PSA_SERIAL_JSON##*${CUSTOMER_ID}/})
|
||||
|
||||
readonly KNOWN_TARIFF_FILES=(${TARIFF_FILES_JSON[@]##*${CUSTOMER_ID}/})
|
||||
|
||||
readonly KNOWN_INI_FILES=(${ATBAPP_PSA_INI_FILE##*${CUSTOMER_ID}/} \
|
||||
${ISMASMGRATB_PSA_INI_FILE##*${CUSTOMER_ID}/} \
|
||||
@ -360,7 +347,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
|
||||
readonly KNOWN_FILES=(${KNOWN_CONF_FILES[@]} \
|
||||
${KNOWN_INI_FILES[@]} \
|
||||
${KNOWN_TARIFF_FILES[@]} \
|
||||
${DC_PSA_DC_FILE##*${CUSTOMER_ID}/} \
|
||||
${OPKG_CMDS_PSA_FILE##*${CUSTOMER_ID}/})
|
||||
|
||||
|
@ -45,8 +45,6 @@ copy () {
|
||||
# macht fuer dc keinen sinn
|
||||
# local sysdir=$(echo $f |
|
||||
# sed -E -e s'=(.*szeged/[0-9]/[0-9])(.*)(/.*)=\2=g')
|
||||
|
||||
# TODO: kuerzen
|
||||
|
||||
copy_necessary=1
|
||||
|
||||
@ -62,8 +60,6 @@ copy () {
|
||||
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"
|
||||
@ -171,22 +167,89 @@ check_md5_for_changed_json_and_ini_files () {
|
||||
# .../szeged/1/1...
|
||||
log_debug "$func:${LINENO} checking file=${file}..."
|
||||
local __fs=${file##*.}
|
||||
|
||||
# local __bn=$(basename $file .$__fsuffix)
|
||||
# local __key_suffix=$(echo $file |
|
||||
# sed -E -e 's=(.*[0-9]/[0-9])([^.]+)(.*)=\2=g' -e 's=/=.=g')
|
||||
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_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)"
|
||||
set +x
|
||||
|
||||
|
||||
;;
|
||||
# *.hex)
|
||||
# js_key=$(echo $file |
|
||||
# sed -E -e 's=(.*szeged)([^.]+)(.*)=\2=g' -e 's=/=.=g')
|
||||
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
|
||||
# md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)"
|
||||
# ;;
|
||||
*)
|
||||
log_crit "$func:${LINENO} unknown file=${file}"
|
||||
;;
|
||||
esac
|
||||
|
||||
#if [[ "$file" =~ .*dc2c.hex.* ]]; then
|
||||
# js_key=$(echo $file |
|
||||
# sed -E -e 's=(.*$CUSTOMER_LOCATION)([^.]+)(.*)=\2=g'
|
||||
# -e 's=/=.=g')
|
||||
# md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
|
||||
# md5sum_repository="$(md5_of $CUSTOMER_ID_BASE_DIR/$file)"
|
||||
#else
|
||||
# if [[ "$file" =~ .*cash[.]json.* ]]; 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)"
|
||||
# elif [[ "$file" =~ .*print[0-9][0-9][.]json.* ]]; 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)"
|
||||
# elif [[ "$file" =~ .*conf[.]json.* ]]; 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)"
|
||||
# elif [[ "$file" =~ .*serial[.]json.* ]]; 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)"
|
||||
####################################################################
|
||||
## ATBQT.ini
|
||||
####################################################################
|
||||
# elif [[ "$file" =~ .*/$ATBQT_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)
|
||||
####################################################################
|
||||
## sysconfig.ini
|
||||
####################################################################
|
||||
# elif [[ "$file" =~ .*/$SYSCONF_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)
|
||||
####################################################################
|
||||
## SystemControl.ini
|
||||
####################################################################
|
||||
# elif [[ "$file" =~ .*/$SYSCTRL_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)
|
||||
####################################################################
|
||||
## 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))
|
||||
|
@ -17,7 +17,7 @@ collect_current_configuration () {
|
||||
current_settings_to_ismas
|
||||
|
||||
#for line in $(cat $PSA_UPDATE_CONF |\
|
||||
# jq -r .conf.szeged.zg[$ZONE_GROUP].z[$ZONE].etc.psa_config)
|
||||
# jq -r .conf.szeged.zg[1].z[1].etc.psa_config)
|
||||
#do
|
||||
# conf_file="$(echo $line |
|
||||
# sed -E -ne 's/^[^{}]\s+\"(DC2C_[[:alnum:]]+)\".*$/\1/gp')"
|
||||
|
Loading…
Reference in New Issue
Block a user