Compare commits

...

4 Commits

4 changed files with 227 additions and 142 deletions

View File

@ -375,6 +375,9 @@ if [ ${news_to_ismas_sourced:-1} = "1" ]; then # include only once
current_settings_to_ismas () { current_settings_to_ismas () {
local func="${FUNCNAME[0]}" local func="${FUNCNAME[0]}"
local p=("$@") local p=("$@")
return 0
local data="#M=APISM#C=CMD_SENDVERSION#J= local data="#M=APISM#C=CMD_SENDVERSION#J=
{ {
\"VERSION_INFO\" : { \"VERSION_INFO\" : {
@ -382,7 +385,7 @@ if [ ${news_to_ismas_sourced:-1} = "1" ]; then # include only once
\"HASH\":\"$(compute_hash)\" \"HASH\":\"$(compute_hash)\"
}, },
\"TARIFF\": { \"TARIFF\": {
$(<$TARIFF_CURRENT_FULL) $(<$TC_PSA_TC_FILE)
}, },
\"HARDWARE\" : { \"HARDWARE\" : {
\"DEVICES\" : [ \"DEVICES\" : [
@ -399,8 +402,8 @@ if [ ${news_to_ismas_sourced:-1} = "1" ]; then # include only once
sed -E -e 's/.*:\s*(.*)/\1/g')\" sed -E -e 's/.*:\s*(.*)/\1/g')\"
}, },
\"DC\" : { \"DC\" : {
\"VERSION\" : \"$(cat $UPDATE_CONF | jq -r .dc.version)\", \"VERSION\" : \"$(cat $PSA_UPDATE_CONF | jq -r .dc.version)\",
\"MD5SUM\" : \"$(cat $UPDATE_CONF | jq -r .dc.dc2c)\" \"MD5SUM\" : \"$(cat $PSA_UPDATE_CONF | jq -r .dc.dc2c)\"
}, },
\"PRINTER\" : { \"PRINTER\" : {
}, },

View File

@ -25,6 +25,7 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
readonly PROGRAM=`basename $0` readonly PROGRAM=`basename $0`
readonly WORKSPACE_DIR=workspace readonly WORKSPACE_DIR=workspace
# TODO: entfernen indem man subtree benutzt
WORKING_DIRECTORY=${WORKING_DIRECTORY:-$UPDATEPSAHOME} WORKING_DIRECTORY=${WORKING_DIRECTORY:-$UPDATEPSAHOME}
CONFIGFILENAME=${CONFIGFILENAME:-'update_psa.conf'} CONFIGFILENAME=${CONFIGFILENAME:-'update_psa.conf'}
@ -39,6 +40,7 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
EXITCODE=$RC_SUCCESS EXITCODE=$RC_SUCCESS
CLONE_CUSTOMER_REPOSITORY=false CLONE_CUSTOMER_REPOSITORY=false
# read config file (JSON syntax) # read config file (JSON syntax)
read_config() { read_config() {
local func="${FUNCNAME[0]}" local func="${FUNCNAME[0]}"
@ -86,7 +88,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
readonly ZONE_GROUPS=(${__zone_groups[@]}) readonly ZONE_GROUPS=(${__zone_groups[@]})
assert_a ZONE_GROUPS assert_a ZONE_GROUPS
return 0 return 0
} }
############################################################################### ###############################################################################
@ -113,20 +114,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
CUSTOMER_LOCATION_DIR="${CUSTOMER_ID_BASE_DIR}/${CUSTOMER_LOCATION}" CUSTOMER_LOCATION_DIR="${CUSTOMER_ID_BASE_DIR}/${CUSTOMER_LOCATION}"
assert_d CUSTOMER_LOCATION_DIR assert_d CUSTOMER_LOCATION_DIR
readonly UPDATE_CONF="${CUSTOMER_LOCATION_DIR}/update.conf"
assert_f UPDATE_CONF
readonly DC="dc2c.hex"
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_FULL="${DC_DIR}/$DC"
assert_d DC_DIR
assert_f DC_FULL
# 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.
readonly local __zgroup=1 readonly local __zgroup=1
@ -143,137 +130,220 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
done done
done done
readonly CUSTOMER_BASE_DIRS=(${__customer_base_dirs[@]}) # for szeged:
assert_a CUSTOMER_BASE_DIRS # placeholder
# /home/root/szeged/UpdateController/workspace/customer_281/szeged/1/1
# /home/root/szeged/UpdateController/workspace/customer_281/szeged/1/2
# /home/root/szeged/UpdateController/workspace/customer_281/szeged/1/3
readonly CUST_BASE_DIRS=(${__customer_base_dirs[@]})
assert_a CUST_BASE_DIRS
# TODO # TODO
# TODO: falls mehrere gruppen/zonen auftauchen hier anpassen # TODO: falls mehrere gruppen/zonen auftauchen hier anpassen
# TODO # TODO
# Zone aus /etc/zone_nr auslesen
#
readonly ZONE=1 readonly ZONE=1
readonly CUSTOMER_BASE_DIR="${CUSTOMER_BASE_DIRS[$ZONE]}" readonly CUST_BASE_DIR="${CUST_BASE_DIRS[$ZONE]}"
assert_d CUSTOMER_BASE_DIR assert_d CUST_BASE_DIR
readonly PSA_CONFIG_DIR="${CUSTOMER_BASE_DIR}/etc/psa_config" readonly ETC_SYS_DIR="/etc"
assert_d PSA_CONFIG_DIR readonly ATB_SYS_DIR="/etc/atb"
readonly DC_SYS_DIR="/etc/dc"
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"
readonly APP_SYS_DIR="/opt/app"
readonly SYSCONFIG_SYS_DIR="/opt/app/sysconfig"
readonly ATBAPP_SYS_DIR="/opt/app/ATBAPP"
readonly ISMASMGR_SYS_DIR="/opt/app/ISMASMgr"
readonly PSA_UPDATE_DIR="${CUSTOMER_BASE_DIR}/etc/psa_update" readonly ETC_PSA_DIR=${CUST_BASE_DIR}${ETC_SYS_DIR}
assert_d PSA_UPDATE_DIR readonly ATB_PSA_DIR=${CUST_BASE_DIR}${ATB_SYS_DIR}
readonly DC_PSA_DIR=${CUST_BASE_DIR}${DC_SYS_DIR}
readonly TARIFF_PSA_DIR=${CUST_BASE_DIR}${TARIFF_SYS_DIR}
readonly OPKG_PSA_DIR=${CUST_BASE_DIR}${OPKG_SYS_DIR}
readonly CONF_PSA_DIR=${CUST_BASE_DIR}${CONF_SYS_DIR}
readonly OPT_PSA_DIR=${CUST_BASE_DIR}${OPT_SYS_DIR}
readonly APP_PSA_DIR=${CUST_BASE_DIR}${APP_SYS_DIR}
readonly ATBAPP_PSA_DIR=${CUST_BASE_DIR}${ATBAPP_SYS_DIR}
readonly SYSCONFIG_PSA_DIR=${CUST_BASE_DIR}${SYSCONFIG_SYS_DIR}
readonly ISMASMGR_PSA_DIR=${CUST_BASE_DIR}${ISMASMGR_SYS_DIR}
readonly ATB_SYS_DIR="/etc/atb" readonly ATBQT_INI="ATBQT.ini"
readonly ISMASMGR_INI="ISMASMgr.ini"
readonly SYSCONF_INI="sysconfig.ini"
readonly SYSCTRL_INI="SystemControl.ini"
readonly TARIFF_CURRENT="tariff.current"
readonly DC="dc2c.hex"
readonly DC_SYS_DC_FILE="${DC_SYS_DIR}/$DC"
readonly ATBQT_ATB_SYS_INI_FILE="${ATB_SYS_DIR}/$ATBQT_INI"
readonly ATBQT_APP_SYS_INI_FILE="${ATBAPP_SYS_DIR}/$ATBQT_INI"
readonly ATBQT_ETC_SYS_INI_FILE="${ETC_SYS_DIR}/$ATBQT_INI"
readonly ISMASMGRATB_SYS_INI_FILE="${ATB_SYS_DIR}/$ISMASMGR_INI"
readonly ISMASMGRAPP_SYS_INI_FILE="${ISMASMGR_SYS_DIR}/$ISMASMGR_INI"
readonly ISMASMGRETC_SYS_INI_FILE="${ETC_SYS_DIR}/$ISMASMGR_INI"
readonly ISMASMGRSCF_SYS_INI_FILE="${SYSCONFIG_SYS_DIR}/$ISMASMGR_INI"
readonly SYSCONF_ETC_SYS_INI_FILE="${ETC_SYS_DIR}/$SYSCONF_INI"
readonly SYSCONF_ATB_SYS_INI_FILE="${ATB_SYS_DIR}/$SYSCONF_INI"
readonly SYSCONF_SCF_SYS_INI_FILE="${SYSCONFIG_SYS_DIR}/$SYSCONF_INI"
readonly SYSCTRL_ETC_SYS_INI_FILE="${ETC_SYS_DIR}/$SYSCTRL_INI"
readonly SYSCTRL_ATB_SYS_INI_FILE="${ATB_SYS_DIR}/$SYSCTRL_INI"
readonly SYSCTRL_SCF_SYS_INI_FILE="${SYSCONFIG_SYS_DIR}/$SYSCTRL_INI"
readonly ZONE_FILE="$ETC_SYS_DIR/zone_nr"
readonly CUST_ID_FILE="$ETC_SYS_DIR/cust_nr"
readonly TC_SYS_TC_FILE="${ATBAPP_SYS_DIR}/$TARIFF_CURRENT"
readonly OPKG_CMDS_SYS_FILE="${OPKG_SYS_DIR}/opkg_commands"
readonly DC2C_SYS_SERIAL_JSON="${CONF_SYS_DIR}/DC2C_serial.json"
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 ATBQT_ATB_PSA_INI_FILE="${ATB_SYS_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 ISMASMGRAPP_PSA_INI_FILE="${ISMASMGR_PSA_DIR}/$ISMASMGR_INI"
readonly ISMASMGRETC_PSA_INI_FILE="${ETC_PSA_DIR}/$ISMASMGR_INI"
readonly ISMASMGRSCF_PSA_INI_FILE="${SYSCONFIG_PSA_DIR}/$ISMASMGR_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_SCF_PSA_INI_FILE="${SYSCONFIG_PSA_DIR}/$SYSCONF_INI"
readonly SYSCTRL_ETC_PSA_INI_FILE="${ETC_SYS_DIR}/$SYSCTRL_INI"
readonly SYSCTRL_ATB_PSA_INI_FILE="${ATB_SYS_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 TC_PSA_TC_FILE="${ATBAPP_PSA_DIR}/$TARIFF_CURRENT"
readonly PSA_UPDATE_CONF="${CUSTOMER_LOCATION_DIR}/update.conf"
readonly DC2C_PSA_SERIAL_JSON="${CONF_PSA_DIR}/DC2C_serial.json"
readonly DC2C_PSA_CASH_JSON="${CONF_PSA_DIR}/DC2C_cash.json"
readonly DC2C_PSA_CONF_JSON="${CONF_PSA_DIR}/DC2C_conf.json"
assert_d ETC_SYS_DIR
assert_d ATB_SYS_DIR assert_d ATB_SYS_DIR
assert_d DC_SYS_DIR
readonly PSA_ATB_SYS_DIR="${CUSTOMER_BASE_DIR}${ATB_SYS_DIR}" assert_d TARIFF_SYS_DIR
assert_d PSA_ATB_SYS_DIR
readonly PSA_BASE_INI_DIR="${CUSTOMER_BASE_DIR}/opt/app"
assert_d PSA_BASE_INI_DIR
readonly SYSCONFIG_SYS_DIR="/opt/app/sysconfig"
assert_d SYSCONFIG_SYS_DIR
readonly PSA_SYSCONFIG_DIR="${CUSTOMER_BASE_DIR}${SYSCONFIG_SYS_DIR}"
assert_d PSA_SYSCONFIG_DIR
readonly PSA_ISMASMGR_DIR="${PSA_BASE_INI_DIR}/ISMASMgr"
assert_d PSA_ISMASMGR_DIR
readonly CONF_SYS_DIR="/etc/psa_config"
assert_d CONF_SYS_DIR
readonly OPKG_SYS_DIR="/etc/psa_update"
assert_d OPKG_SYS_DIR assert_d OPKG_SYS_DIR
assert_d CONF_SYS_DIR
readonly ATBAPP_SYS_DIR="/opt/app/ATBAPP" assert_d OPT_SYS_DIR
assert_d APP_SYS_DIR
assert_d ATBAPP_SYS_DIR assert_d ATBAPP_SYS_DIR
assert_d SYSCONFIG_SYS_DIR
readonly PSA_ATBQT_DIR="$CUSTOMER_BASE_DIR$ATBAPP_SYS_DIR"
assert_d PSA_ATBQT_DIR
readonly TARIFF_CURRENT="tariff.current"
readonly TARIFF_CURRENT_FULL="${PSA_ATBQT_DIR}/$TARIFF_CURRENT"
assert_f TARIFF_CURRENT_FULL
readonly ATBQT_INI="ATBQT.ini"
readonly ATBQT_INI_FULL="${PSA_ATBQT_DIR}/$ATBQT_INI"
assert_f ATBQT_INI_FULL
readonly ATBQT="ATBQT"
readonly ATBQT_SYS_FULL="${ATBAPP_SYS_DIR}/$ATBQT"
assert_f ATBQT_SYS_FULL
readonly ISMASMGR_INI="ISMASMgr.ini"
readonly ISMASMGR_SYS_DIR="/opt/app/ISMASMgr"
assert_d ISMASMGR_SYS_DIR assert_d ISMASMGR_SYS_DIR
readonly ISMASMGR_ISMASMGR_INI_FULL="${PSA_ISMASMGR_DIR}/$ISMASMGR_INI" assert_d ETC_PSA_DIR
assert_f ISMASMGR_ISMASMGR_INI_FULL assert_d ATB_PSA_DIR
assert_d DC_PSA_DIR
assert_d TARIFF_PSA_DIR
assert_d OPKG_PSA_DIR
assert_d CONF_PSA_DIR
assert_d OPT_PSA_DIR
assert_d APP_PSA_DIR
assert_d ATBAPP_PSA_DIR
assert_d SYSCONFIG_PSA_DIR
assert_d ISMASMGR_PSA_DIR
readonly SYSCONFIG_ISMASMGR_INI_FULL="${PSA_SYSCONFIG_DIR}/ISMASMgr.ini" assert_f DC_SYS_DC_FILE
assert_f SYSCONFIG_ISMASMGR_INI_FULL assert_f ZONE_FILE
assert_f CUST_ID_FILE
assert_f ATBQT_ATB_SYS_INI_FILE
assert_f ATBQT_APP_SYS_INI_FILE
assert_f ATBQT_ETC_SYS_INI_FILE
assert_f ISMASMGRATB_SYS_INI_FILE
assert_f ISMASMGRAPP_SYS_INI_FILE
assert_f ISMASMGRETC_SYS_INI_FILE
assert_f ISMASMGRSCF_SYS_INI_FILE
assert_f SYSCONF_ETC_SYS_INI_FILE
assert_f SYSCONF_ATB_SYS_INI_FILE
assert_f SYSCONF_SCF_SYS_INI_FILE
assert_f SYSCTRL_ETC_SYS_INI_FILE
assert_f SYSCTRL_ATB_SYS_INI_FILE
assert_f SYSCTRL_SCF_SYS_INI_FILE
assert_f TC_SYS_TC_FILE
assert_f OPKG_CMDS_SYS_FILE
assert_f DC2C_SYS_CONF_JSON
assert_f DC2C_SYS_SERIAL_JSON
assert_f DC2C_SYS_CASH_JSON
readonly ATB_ISMASMGR_INI_FULL="${PSA_ATB_SYS_DIR}/$ISMASMGR_INI" assert_f DC_PSA_DC_FILE
assert_f ATB_ISMASMGR_INI_FULL assert_f ATBQT_ATB_PSA_INI_FILE
assert_f ATBQT_APP_PSA_INI_FILE
assert_f ATBQT_ETC_PSA_INI_FILE
assert_f ISMASMGRATB_PSA_INI_FILE
assert_f ISMASMGRAPP_PSA_INI_FILE
assert_f ISMASMGRETC_PSA_INI_FILE
assert_f ISMASMGRSCF_PSA_INI_FILE
assert_f SYSCONF_ETC_PSA_INI_FILE
assert_f SYSCONF_ATB_PSA_INI_FILE
assert_f SYSCONF_SCF_PSA_INI_FILE
assert_f SYSCTRL_ETC_PSA_INI_FILE
assert_f SYSCTRL_ATB_PSA_INI_FILE
assert_f SYSCTRL_SCF_PSA_INI_FILE
assert_f ATB_PSA_INI_FILE
assert_f TC_PSA_TC_FILE
assert_f PSA_UPDATE_CONF
assert_f OPKG_CMDS_PSA_FILE
assert_f DC2C_PSA_CONF_JSON
assert_f DC2C_PSA_SERIAL_JSON
assert_f DC2C_PSA_CASH_JSON
readonly SYS_CONFIG_INI="sysconfig.ini" readonly KNOWN_SYS_DIRS=($ETC_SYS_DIR
readonly __sysc_sysc_full="${PSA_SYSCONFIG_DIR}/$SYS_CONFIG_INI" $ATB_SYS_DIR
readonly SYSCONFIG_SYSCONFIG_INI_FULL="$__sysc_sysc_full" $DC_SYS_DIR
assert_f SYSCONFIG_SYSCONFIG_INI_FULL $TARIFF_SYS_DIR
$OPKG_SYS_DIR
$CONF_SYS_DIR
$OPT_SYS_DIR
$APP_SYS_DIR
$ATBAPP_SYS_DIR
$SYSCONFIG_SYS_DIR)
readonly ATB_SYSCONFIG_INI_FULL="${PSA_ATB_SYS_DIR}/$SYS_CONFIG_INI" readonly KNOWN_PSA_DIRS=($ETC_PSA_DIR
assert_f ATB_SYSCONFIG_INI_FULL $ATB_PSA_DIR
$DC_PSA_DIR
readonly "SYSTEM_CONTROL_INI"="SystemControl.ini" $TARIFF_PSA_DIR
local __sysctrl_ini_full="${PSA_SYSCONFIG_DIR}/$SYSTEM_CONTROL_INI" $OPKG_PSA_DIR
readonly SYSCONFIG_SYSCTRL_INI_FULL="$__sysctrl_ini_full" $CONF_PSA_DIR
assert_f SYSCONFIG_SYSCTRL_INI_FULL $OPT_PSA_DIR
$APP_PSA_DIR
readonly ATB_SYSCTRL_INI_FULL="${PSA_ATB_SYS_DIR}/$SYSTEM_CONTROL_INI" $ATBAPP_PSA_DIR
assert_f ATB_SYSCTRL_INI_FULL $SYSCONFIG_PSA_DIR)
readonly ATB_ATBQT_INI_FULL="${PSA_ATB_SYS_DIR}/$ATBQT_INI"
assert_f ATB_ATBQT_INI_FULL
readonly DC2C_SERIAL_JSON="${PSA_CONFIG_DIR}/DC2C_serial.json"
assert_f DC2C_SERIAL_JSON
readonly DC2C_CASH_JSON="${PSA_CONFIG_DIR}/DC2C_cash.json"
assert_f DC2C_CASH_JSON
readonly DC2C_CONF_JSON="${PSA_CONFIG_DIR}/DC2C_conf.json"
assert_f DC2C_CONF_JSON
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=${CONF_PSA_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)
assert_f DC2C_PRINT$(printf "%02d" $i)_JSON assert_f DC2C_PRINT$(printf "%02d" $i)_JSON
DC2C_PRINT_JSON+=($__f) DC2C_PRINT_JSON+=($__f)
done done
readonly OPKG_CMDS_FILE="${PSA_UPDATE_DIR}/opkg_commands" readonly KNOWN_CONF_FILES=(${CUSTOMER_LOCATION}/update.conf \
assert_f OPKG_CMDS_FILE ${DC2C_PRINT_JSON[@]##*${CUSTOMER_ID}/} \
${DC2C_PSA_CONF_JSON##*${CUSTOMER_ID}/} \
${DC2C_PSA_CASH_JSON##*${CUSTOMER_ID}/} \
${DC2C_PSA_SERIAL_JSON##*${CUSTOMER_ID}/})
# TODO: anpassen, da z.B. fuer szeged mehrere zonen vorhanden sind readonly KNOWN_INI_FILES=(${ATBAPP_PSA_INI_FILE##*${CUSTOMER_ID}/} \
readonly KNOWN_CONF_FILES=(${CUSTOMER_LOCATION}/update.conf \ ${ISMASMGRATB_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${DC2C_PRINT_JSON[@]##*${CUSTOMER_ID}/} \ ${ISMASMGRAPP_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${DC2C_CONF_JSON##*${CUSTOMER_ID}/} \ ${ISMASMGRETC_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${DC2C_CASH_JSON##*${CUSTOMER_ID}/} \ ${ISMASMGRSCF_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${DC2C_SERIAL_JSON##*${CUSTOMER_ID}/}) ${SYSCONF_ETC_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${SYSCONF_ATB_PSA_INI_FILE##*${CUSTOMER_ID}/} \
readonly KNOWN_INI_FILES=(${ATBQT_INI_FULL##*${CUSTOMER_ID}/} \ ${SYSCONF_SCF_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${ISMASMGR_ISMASMGR_INI_FULL##*${CUSTOMER_ID}/} \ ${SYSCTRL_ETC_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${SYSCONFIG_ISMASMGR_INI_FULL##*${CUSTOMER_ID}/} \ ${SYSCTRL_ATB_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${SYSCONFIG_SYSCONFIG_INI_FULL##*${CUSTOMER_ID}/} \ ${SYSCTRL_SCF_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${SYSCONFIG_SYSCTRL_INI_FULL##*${CUSTOMER_ID}/} \ ${ATBQT_ATB_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${ATB_ISMASMGR_INI_FULL##*${CUSTOMER_ID}/} \ ${ATBQT_APP_PSA_INI_FILE##*${CUSTOMER_ID}/} \
${ATB_SYSCONFIG_INI_FULL##*${CUSTOMER_ID}/} \ ${ATBQT_ETC_PSA_INI_FILE##*${CUSTOMER_ID}/})
${ATB_SYSCTRL_INI_FULL##*${CUSTOMER_ID}/} \
${ATB_ATBQT_INI_FULL##*${CUSTOMER_ID}/})
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_PSA_FILE##*${CUSTOMER_ID}/})
log_debug "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

View File

@ -163,59 +163,63 @@ check_md5_for_changed_json_and_ini_files () {
local __bn=$(basename $file .$__fsuffix) local __bn=$(basename $file .$__fsuffix)
if [[ "$file" =~ .*dc2c.hex.* ]]; then if [[ "$file" =~ .*dc2c.hex.* ]]; then
js_key=".dc.dc2c.$__bn" js_key=".dc.dc2c.$__bn"
md5sum_update_conf=$(cat $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" =~ .*cash[.]json.* ]]; then elif [[ "$file" =~ .*cash[.]json.* ]]; then
js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.$__bn" js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.$__bn"
md5sum_update_conf=$(cat $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" =~ .*print[0-9][0-9][.]json.* ]]; then elif [[ "$file" =~ .*print[0-9][0-9][.]json.* ]]; then
js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.$__bn" js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.$__bn"
md5sum_update_conf=$(cat $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 elif [[ "$file" =~ .*conf[.]json.* ]]; then
js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.DC2C_conf" js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.DC2C_conf"
md5sum_update_conf=$(cat $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" =~ .*serial[.]json.* ]]; then elif [[ "$file" =~ .*serial[.]json.* ]]; then
js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.DC2C_serial" js_key=".conf.$__cl.zg[1].z[1].etc.psa_config.DC2C_serial"
md5sum_update_conf=$(cat $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" =~ .*atb/ATBQT[.]ini.* ]]; then elif [[ "$file" =~ .*atb/ATBQT[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].etc.atb.ATBQT" js_key=".ini.$__cl.zg[1].z[1].etc.atb.ATBQT"
md5sum_update_conf=$(cat $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 $ATB_ATBQT_INI_FULL)"
elif [[ "$file" =~ .*ATBQT[.]ini.* ]]; then elif [[ "$file" =~ .*ATBQT[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].opt.app.ATBAPP.ATBQT" js_key=".ini.$__cl.zg[1].z[1].opt.app.ATBAPP.ATBQT"
md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
md5sum_repository="$(md5_of $ATBQT_INI_FULL)" md5sum_repository="$(md5_of $ATBQT_INI_FULL)"
elif [[ "$file" =~ .*atb/sysconfig[.]ini.* ]]; then elif [[ "$file" =~ .*atb/sysconfig[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].etc.atb.sysconfig" js_key=".ini.$__cl.zg[1].z[1].etc.atb.sysconfig"
md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
md5sum_repository="$(md5_of $ATB_SYSCONFIG_INI_FULL)" md5sum_repository="$(md5_of $ATB_SYSCONFIG_INI_FULL)"
elif [[ "$file" =~ .*sysconfig[.]ini.* ]]; then elif [[ "$file" =~ .*sysconfig[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].opt.app.sysconfig.sysconfig" js_key=".ini.$__cl.zg[1].z[1].opt.app.sysconfig.sysconfig"
md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
md5sum_repository=$(md5_of $SYSCONFIG_SYSCONFIG_INI_FULL) md5sum_repository=$(md5_of $SYSCONFIG_SYSCONFIG_INI_FULL)
elif [[ "$file" =~ .*atb/SystemControl[.]ini.* ]]; then elif [[ "$file" =~ .*atb/SystemControl[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].etc.atb.SystemControl" js_key=".ini.$__cl.zg[1].z[1].etc.atb.SystemControl"
md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
md5sum_repository="$(md5_of $ATB_SYSCTRL_INI_FULL)" md5sum_repository="$(md5_of $ATB_SYSCTRL_INI_FULL)"
elif [[ "$file" =~ .*SystemControl[.]ini.* ]]; then elif [[ "$file" =~ .*SystemControl[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].opt.app.sysconfig.SystemControl" js_key=".ini.$__cl.zg[1].z[1].opt.app.sysconfig.SystemControl"
md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
md5sum_repository=$(md5_of $SYSCONFIG_SYSCTRL_INI_FULL) md5sum_repository=$(md5_of $SYSCONFIG_SYSCTRL_INI_FULL)
elif [[ "$file" =~ .*atb/ISMASMgr[.]ini.* ]]; then elif [[ "$file" =~ .*atb/ISMASMgr[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].etc.atb.ISMASMgr" js_key=".ini.$__cl.zg[1].z[1].etc.atb.ISMASMgr"
md5sum_update_conf=$(cat $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)"
elif [[ "$file" =~ .*etc/ISMASMgr[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].etc.ISMASMgr"
md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
md5sum_repository="$(md5_of $ATB_ISMASMGR_INI_FULL)" md5sum_repository="$(md5_of $ATB_ISMASMGR_INI_FULL)"
elif [[ "$file" =~ .*ISMASMgr/ISMASMgr[.]ini.* ]]; then elif [[ "$file" =~ .*ISMASMgr/ISMASMgr[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].opt.app.ISMASMgr.ISMASMgr" js_key=".ini.$__cl.zg[1].z[1].opt.app.ISMASMgr.ISMASMgr"
md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
md5sum_repository=$(md5_of $ISMASMGR_ISMASMGR_INI_FULL) md5sum_repository=$(md5_of $ISMASMGR_ISMASMGR_INI_FULL)
elif [[ "$file" =~ .*sysconfig/ISMASMgr[.]ini.* ]]; then elif [[ "$file" =~ .*sysconfig/ISMASMgr[.]ini.* ]]; then
js_key=".ini.$__cl.zg[1].z[1].opt.app.sysconfig.ISMASMgr" js_key=".ini.$__cl.zg[1].z[1].opt.app.sysconfig.ISMASMgr"
md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key) md5sum_update_conf=$(cat $PSA_UPDATE_CONF | jq -r $js_key)
md5sum_repository=$(md5_of $SYSCONFIG_ISMASMGR_INI_FULL) md5sum_repository=$(md5_of $SYSCONFIG_ISMASMGR_INI_FULL)
else else
continue continue
@ -398,6 +402,14 @@ check_for_apism () {
nc localhost 7778 nc localhost 7778
} }
get_customer_id () {
echo $(cat CUST_ID_FILE)
}
get_zone_nr () {
echo $(cat ZONE_FILE)
}
get_plugins () { get_plugins () {
local __plugins="" local __plugins=""
for __f in /opt/app/ATBAPP/plugins/*; do for __f in /opt/app/ATBAPP/plugins/*; do

View File

@ -16,7 +16,7 @@ collect_current_configuration () {
# TODO: eventuell muss die version neu berechnet werden # TODO: eventuell muss die version neu berechnet werden
current_settings_to_ismas current_settings_to_ismas
#for line in $(cat $UPDATE_CONF |\ #for line in $(cat $PSA_UPDATE_CONF |\
# jq -r .conf.szeged.zg[1].z[1].etc.psa_config) # jq -r .conf.szeged.zg[1].z[1].etc.psa_config)
#do #do
# conf_file="$(echo $line | # conf_file="$(echo $line |