use of capitalized global variables; added check_for_apism()

This commit is contained in:
Gerhard Hoffmann 2022-06-03 21:50:15 +02:00
parent 2f169e966e
commit f9276b3fdb

View File

@ -42,9 +42,9 @@ copy () {
fi fi
if grep -qE "^.*[.]conf\s*$" <<< ${f}; then if grep -qE "^.*[.]conf\s*$" <<< ${f}; then
local __f=${f#*etc/} local __f=${f#*etc/}
if ! cp "${customer_id_base_dir}/${f}" "/etc/${__f}"; then if ! cp "${CUSTOMER_ID_BASE_DIR}/${f}" "/etc/${__f}"; then
log_error "$func:${LINENO}: cannot "\ log_error "$func:${LINENO}: cannot "\
"cp ${customer_id_base_dir}/${f} /etc/${__f}" "cp ${CUSTOMER_ID_BASE_DIR}/${f} /etc/${__f}"
return 1 return 1
fi fi
log_info "$func:${LINENO}: copied $f to /etc/${__f}" log_info "$func:${LINENO}: copied $f to /etc/${__f}"
@ -52,10 +52,10 @@ copy () {
# TODO: die anderen system-verzeichnisse werden gebraucht # TODO: die anderen system-verzeichnisse werden gebraucht
local __f=${f#*opt/app/ATBAPP/} local __f=${f#*opt/app/ATBAPP/}
if [ "$__f" = "ATBQT.ini" ]; then if [ "$__f" = "ATBQT.ini" ]; then
if ! cp "${customer_id_base_dir}/${f}" /opt/app/ATBAPP/${__f} if ! cp "${CUSTOMER_ID_BASE_DIR}/${f}" /opt/app/ATBAPP/${__f}
then then
log_error "$func:${LINENO}: cannot "\ log_error "$func:${LINENO}: cannot "\
"cp ${customer_id_base_dir}/${f} /opt/app/ATBAPP/${__f}" "cp ${CUSTOMER_ID_BASE_DIR}/${f} /opt/app/ATBAPP/${__f}"
return 1 return 1
fi fi
fi fi
@ -107,35 +107,35 @@ check_md5_for_changed_conf_and_ini_files () {
log_debug "$func:${LINENO} file=$file" log_debug "$func:${LINENO} file=$file"
if [[ "$file" =~ .*emp[.]conf.* ]]; then if [[ "$file" =~ .*emp[.]conf.* ]]; then
js_key=".conf.szeged.zg[1].z[1].etc.psa_config.emp" js_key=".conf.szeged.zg[1].z[1].etc.psa_config.emp"
md5sum_update_conf=$(cat $update_conf | jq -r $js_key) md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key)
md5sum_repository="$(md5_of $emp_conf)" md5sum_repository="$(md5_of $emp_conf)"
elif [[ "$file" =~ .*printer[.]conf.* ]]; then elif [[ "$file" =~ .*printer[.]conf.* ]]; then
js_key=".conf.szeged.zg[1].z[1].etc.psa_config.printer" js_key=".conf.szeged.zg[1].z[1].etc.psa_config.printer"
md5sum_update_conf=$(cat $update_conf | jq -r $js_key) md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key)
md5sum_repository="$(md5_of $printer_conf)" md5sum_repository="$(md5_of $printer_conf)"
elif [[ "$file" =~ .*device[.]conf.* ]]; then elif [[ "$file" =~ .*device[.]conf.* ]]; then
js_key=".conf.szeged.zg[1].z[1].etc.psa_config.device" js_key=".conf.szeged.zg[1].z[1].etc.psa_config.device"
md5sum_update_conf=$(cat $update_conf | jq -r $js_key) md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key)
md5sum_repository="$(md5_of $device_conf)" md5sum_repository="$(md5_of $device_conf)"
elif [[ "$file" =~ .*ATBQT[.]ini.* ]]; then elif [[ "$file" =~ .*ATBQT[.]ini.* ]]; then
js_key=".ini.szeged.zg[1].z[1].opt.app.ATBAPP.ATBQT" js_key=".ini.szeged.zg[1].z[1].opt.app.ATBAPP.ATBQT"
md5sum_update_conf=$(cat $update_conf | jq -r $js_key) md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key)
md5sum_repository="$(md5_of $atbqt_ini)" md5sum_repository="$(md5_of $atbqt_ini)"
elif [[ "$file" =~ .*sysconfig[.]ini.* ]]; then elif [[ "$file" =~ .*sysconfig[.]ini.* ]]; then
js_key=".ini.szeged.zg[1].z[1].opt.app.sysconfig.sysconfig" js_key=".ini.szeged.zg[1].z[1].opt.app.sysconfig.sysconfig"
md5sum_update_conf=$(cat $update_conf | jq -r $js_key) md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key)
md5sum_repository=$(md5_of $sysconfig_sysconfig_ini) md5sum_repository=$(md5_of $sysconfig_sysconfig_ini)
elif [[ "$file" =~ .*SystemControl[.]ini.* ]]; then elif [[ "$file" =~ .*SystemControl[.]ini.* ]]; then
js_key=".ini.szeged.zg[1].z[1].opt.app.sysconfig.SystemControl" js_key=".ini.szeged.zg[1].z[1].opt.app.sysconfig.SystemControl"
md5sum_update_conf=$(cat $update_conf | jq -r $js_key) md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key)
md5sum_repository=$(md5_of $sysconfig_sysctrl_ini) md5sum_repository=$(md5_of $sysconfig_sysctrl_ini)
elif [[ "$file" =~ .*ISMASMgr/ISMASMgr[.]ini.* ]]; then elif [[ "$file" =~ .*ISMASMgr/ISMASMgr[.]ini.* ]]; then
js_key=".ini.szeged.zg[1].z[1].opt.app.ISMASMgr.ISMASMgr" js_key=".ini.szeged.zg[1].z[1].opt.app.ISMASMgr.ISMASMgr"
md5sum_update_conf=$(cat $update_conf | jq -r $js_key) md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key)
md5sum_repository=$(md5_of $ismasmgr_ismasmgr_ini) md5sum_repository=$(md5_of $ismasmgr_ismasmgr_ini)
elif [[ "$file" =~ .*sysconfig/ISMASMgr[.]ini.* ]]; then elif [[ "$file" =~ .*sysconfig/ISMASMgr[.]ini.* ]]; then
js_key=".ini.szeged.zg[1].z[1].opt.app.sysconfig.ISMASMgr" js_key=".ini.szeged.zg[1].z[1].opt.app.sysconfig.ISMASMgr"
md5sum_update_conf=$(cat $update_conf | jq -r $js_key) md5sum_update_conf=$(cat $UPDATE_CONF | jq -r $js_key)
md5sum_repository=$(md5_of $sysconfig_ismasmgr_ini) md5sum_repository=$(md5_of $sysconfig_ismasmgr_ini)
else else
continue continue
@ -174,7 +174,7 @@ check_md5_for_opkg_packages () {
fi fi
done done
local __update_conf="${customer_location_dir}/update.conf" local __update_conf="${CUSTOMER_LOCATION_DIR}/update.conf"
md5sum_repo=$(cat $__update_conf | jq -r .opkg.${package}.MD5Sum) md5sum_repo=$(cat $__update_conf | jq -r .opkg.${package}.MD5Sum)
if ! [ -z $md5sum_repo ]; then if ! [ -z $md5sum_repo ]; then
if [ "$md5sum_opkg_info" = "$md5sum_repo" ]; then if [ "$md5sum_opkg_info" = "$md5sum_repo" ]; then
@ -294,3 +294,13 @@ cleanup_previous_version() {
local func="${FUNCNAME[0]}" local func="${FUNCNAME[0]}"
return 0 return 0
} }
check_for_apism () {
nc localhost 7778
if [ $? -eq 0 ]
then
return 0
fi
return 1
}