using json instead of conf. started collect_current_configuration
This commit is contained in:
parent
2158f65c65
commit
d8f36deca0
@ -8,6 +8,26 @@ source ./read_config
|
|||||||
source ./news_to_ismas
|
source ./news_to_ismas
|
||||||
source ./news_from_ismas
|
source ./news_from_ismas
|
||||||
|
|
||||||
|
trap collect_current_configuration EXIT
|
||||||
|
|
||||||
|
collect_current_configuration () {
|
||||||
|
local func="${FUNCNAME[0]}"
|
||||||
|
echo $func
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
for line in $(cat $UPDATE_CONF |\
|
||||||
|
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')"
|
||||||
|
if ! [ -z $conf_file ]; then
|
||||||
|
local v=$(cat "$psa_config_dir/${conf_file}.json" | jq -r .version)
|
||||||
|
echo "$conf_file.json version=$v"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
update_psa() {
|
update_psa() {
|
||||||
|
|
||||||
if ! updates_available; then # check for false alarm
|
if ! updates_available; then # check for false alarm
|
||||||
@ -67,28 +87,28 @@ update_psa() {
|
|||||||
# dateinen zu ueberpruefen
|
# dateinen zu ueberpruefen
|
||||||
|
|
||||||
local changed_files=$(changed_file_names)
|
local changed_files=$(changed_file_names)
|
||||||
local conf_ini_files=$(filter_conf_ini_files "$changed_files")
|
local json_ini_files=$(filter_json_ini_files "$changed_files")
|
||||||
|
|
||||||
update_psa_report_changed_file_names $changed_files # message to ISMAS
|
update_psa_report_changed_file_names $changed_files # message to ISMAS
|
||||||
|
|
||||||
# check if *.conf and/or *.ini-files have to md5-sum as denoted
|
# check if *.conf and/or *.ini-files have to md5-sum as denoted
|
||||||
# in update.conf
|
# in update.conf
|
||||||
if ! check_md5_for_changed_conf_and_ini_files "$conf_ini_files" ; then
|
if ! check_md5_for_changed_json_and_ini_files "$json_ini_files" ; then
|
||||||
local __r=$?
|
local __r=$?
|
||||||
log_error "$func:${LINENO}: new customer files wrong"
|
log_error "$func:${LINENO}: new customer files wrong"
|
||||||
revert_customer_repository
|
revert_customer_repository
|
||||||
exit $__r
|
exit $__r
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! check_hardware_compatibility "$conf_ini_files" ; then
|
if ! check_hardware_compatibility "$json_ini_files" ; then
|
||||||
local __r=$?
|
local __r=$?
|
||||||
log_error "$func:${LINENO}: conf/ini-files not fit for PSA"
|
log_error "$func:${LINENO}: json/ini-files not fit for PSA"
|
||||||
revert_customer_repository
|
revert_customer_repository
|
||||||
exit $__r
|
exit $__r
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy *.conf and/or *.ini-files to their corresponding system-directories
|
# copy *.conf and/or *.ini-files to their corresponding system-directories
|
||||||
if ! copy $conf_ini_files; then
|
if ! copy $json_ini_files; then
|
||||||
local __r=$?
|
local __r=$?
|
||||||
log_error "$func:${LINENO}: copy operation failed"
|
log_error "$func:${LINENO}: copy operation failed"
|
||||||
revert_customer_repository
|
revert_customer_repository
|
||||||
@ -147,6 +167,10 @@ update_psa() {
|
|||||||
if ! cleanup_previous_version; then
|
if ! cleanup_previous_version; then
|
||||||
log_error "$func:${LINENO}: cleanup_previous_version failed"
|
log_error "$func:${LINENO}: cleanup_previous_version failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# TODO: nach (erfolgreichem) abschluss sollte man immer das aktuelle setting
|
||||||
|
# ans ISMAS schicken. ISMAS sollte immer wissen, was gerade auf dem
|
||||||
|
# Automaten steht.
|
||||||
|
|
||||||
update_psa_cleanup $UPDATE_ISMAS_PROGRESS \
|
update_psa_cleanup $UPDATE_ISMAS_PROGRESS \
|
||||||
$RC_SUCCESS "cleanup after psa update"
|
$RC_SUCCESS "cleanup after psa update"
|
||||||
|
Loading…
Reference in New Issue
Block a user